From 6cfcb25b7809322e07b594c117bf7e5ad7e9dff4 Mon Sep 17 00:00:00 2001 From: Nathaniel Catchpole Date: Mon, 12 Aug 2013 14:28:56 +0100 Subject: [PATCH] Issue #2046385 by dawehner, pwolanin: Fixed _menu_navigation_links_rebuild() fails when menu_link module is not enabled. --- core/includes/menu.inc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/core/includes/menu.inc b/core/includes/menu.inc index f68e1f6b95a..f6188cd7938 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -2840,15 +2840,13 @@ function menu_get_router() { * @todo This function should be removed/refactored. */ function _menu_navigation_links_rebuild($menu) { - if (module_exists('menu_link')) { - $menu_link_controller = Drupal::entityManager() - ->getStorageController('menu_link'); - } - else { - // The Menu link module is not available at install time, so we need to - // hardcode the default storage controller. - $menu_link_controller = new MenuLinkStorageController('menu_link', Drupal::service('database'), Drupal::service('router.route_provider')); + if (!module_exists('menu_link')) { + // The Menu link module may not be available during install, so rebuild + // when possible. + return; } + $menu_link_controller = Drupal::entityManager() + ->getStorageController('menu_link'); // Add normal and suggested items as links. $router_items = array();