diff --git a/core/includes/menu.inc b/core/includes/menu.inc index 96791e3..2bbc02d 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -3226,9 +3226,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/user/user.module b/core/modules/user/user.module index 1f94436..6dbc528 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -1844,12 +1844,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( @@ -3979,3 +3973,14 @@ function user_file_download_access($field, $entity_type, $entity) { return user_view_access($entity); } } + +/** + * Implements hook_menu_breadcrumb_alter(). + */ +function user_menu_breadcrumb_alter(&$active_trail, $item) { + // Remove 'My account' from the breadcrumb when $item is a descendant of + // system path 'user/%user'. + if (strpos($item['path'], 'user/%') === 0 && $active_trail[1]['module'] == 'system') { + array_splice($active_trail, 1, 1); + } +}