diff --git a/core/includes/menu.inc b/core/includes/menu.inc index fecd158..06b9b81 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -1833,7 +1833,7 @@ function menu_navigation_links($menu_name, $level = 0) { foreach ($tree as $item) { if (!$item['link']['hidden']) { $class = ''; - $l = $item['link']['localized_options']; + $l = isset($item['link']['localized_options']) ? $item['link']['localized_options'] : array(); $l['href'] = $item['link']['href']; $l['title'] = $item['link']['title']; if ($item['link']['in_active_trail']) { @@ -3220,9 +3220,6 @@ function _menu_link_find_parent($menu_link, $parent_candidates = array()) { if ($menu_link['module'] == 'system') { $query = db_select('menu_links'); $query->condition('module', 'system'); - // We always respect the link's 'menu_name'; inheritance for router items is - // ensured in _menu_router_build(). - $query->condition('menu_name', $menu_link['menu_name']); // Find the parent - it must be unique. $parent_path = $menu_link['link_path']; diff --git a/core/modules/system/tests/menu.test b/core/modules/system/tests/menu.test index 8d1d651..3795f39 100644 --- a/core/modules/system/tests/menu.test +++ b/core/modules/system/tests/menu.test @@ -1127,7 +1127,7 @@ class MenuBreadcrumbTestCase extends MenuWebTestCase { $trail += array( 'admin/structure/menu/manage/navigation' => t('Navigation'), ); - $this->assertBreadcrumb("admin/structure/menu/item/6/edit", $trail); + $this->assertBreadcrumb("admin/structure/menu/item/5/edit", $trail); $this->assertBreadcrumb('admin/structure/menu/manage/navigation/edit', $trail); $this->assertBreadcrumb('admin/structure/menu/manage/navigation/add', $trail); diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 3b1d9cb..8e3b90a 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -1636,6 +1636,9 @@ function user_menu() { 'file' => 'user.pages.inc', 'weight' => -10, 'menu_name' => 'user-menu', + // We use type MENU_VISIBLE_IN_TREE instead of type MENU_NORMAL_ITEM so + // that the link to 'user' does not show up in the breadcrumb. + 'type' => MENU_VISIBLE_IN_TREE, ); $items['user/login'] = array( @@ -1780,12 +1783,6 @@ function user_menu() { 'page arguments' => array(1), 'access callback' => 'user_view_access', 'access arguments' => array(1), - // By assigning a different menu name, this item (and all registered child - // paths) are no longer considered as children of 'user'. When accessing the - // user account pages, the preferred menu link that is used to build the - // active trail (breadcrumb) will be found in this menu (unless there is - // more specific link), so the link to 'user' will not be in the breadcrumb. - 'menu_name' => 'navigation', ); $items['user/%user/view'] = array(