diff --git a/core/includes/menu.inc b/core/includes/menu.inc index da75375..84e48fe 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -2663,11 +2663,14 @@ function menu_link_rebuild_defaults() { if (!$existing_item->customized) { // A change in hook_menu_link_defaults() may move the link to a - // different menu. + // different menu or parent. if (!empty($link['menu_name']) && ($link['menu_name'] != $existing_item->menu_name)) { $menu_link->plid = NULL; $menu_link->menu_name = $link['menu_name']; } + elseif (!empty($link['parent'])) { + $menu_link->plid = NULL; + } $menu_link->original = $existing_item; } diff --git a/core/modules/block/block.module b/core/modules/block/block.module index ae8ced6..ba915a9 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -121,7 +121,7 @@ function block_menu() { */ function block_menu_link_defaults() { $links['block.admin.structure'] = array( - 'link_title' => 'Blocks', + 'link_title' => 'Block layout', 'parent' => 'system.admin.structure', 'description' => 'Configure what block content appears in your site\'s sidebars and other regions.', 'route_name' => 'block.admin_display', diff --git a/core/modules/block/custom_block/custom_block.module b/core/modules/block/custom_block/custom_block.module index 1f481b9..cdf90c7 100644 --- a/core/modules/block/custom_block/custom_block.module +++ b/core/modules/block/custom_block/custom_block.module @@ -87,13 +87,13 @@ function custom_block_menu() { * Implements hook_menu_link_defaults(). */ function custom_block_menu_link_defaults() { - $items['custom_block.add_page'] = array( + $links['custom_block.add_page'] = array( 'link_title' => 'Add custom block', 'description' => 'Add custom block', 'route_name' => 'custom_block.add_page', ); - return $items; + return $links; } /** diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 6608075..fc4308d 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -201,9 +201,9 @@ function comment_menu() { */ function comment_menu_link_defaults() { $links['comment.admin.content'] = array( - 'link_title' => 'Comments', + 'link_title' => 'Comment forms', 'route_name' => 'comment.admin', - 'parent' => 'node.admin.content', + 'parent' => 'system.admin.structure', 'description' => 'List and edit site comments and the comment approval queue.', ); diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module index 779b3da..bb967db 100644 --- a/core/modules/contact/contact.module +++ b/core/modules/contact/contact.module @@ -90,7 +90,7 @@ function contact_menu_link_defaults() { 'route_name' => 'contact.category_list', ); - $links['contact'] = array( + $links['contact.site_page'] = array( 'link_title' => 'Contact', 'route_name' => 'contact.site_page', 'menu_name' => 'footer', diff --git a/core/modules/menu/menu.install b/core/modules/menu/menu.install index 686a9e8..de0415f 100644 --- a/core/modules/menu/menu.install +++ b/core/modules/menu/menu.install @@ -11,6 +11,13 @@ * Implements hook_install(). */ function menu_install() { + // Rebuild all the menu data. + // @todo - remove this when we understand why removing it breaks the + // standard install profile, possibly need to be handled in + // \Drupal\Core\Extension\ModuleHandler::install(). + // @see https://drupal.org/node/2181151 + \Drupal::service('router.builder')->rebuild(); + menu_router_rebuild(); if (\Drupal::moduleHandler()->moduleExists('node')) { $node_types = array_keys(node_type_get_names()); foreach ($node_types as $type_id) { diff --git a/core/modules/node/node.module b/core/modules/node/node.module index ec0cd7c..cc91b12 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -982,6 +982,7 @@ function node_menu_link_defaults() { 'route_name' => 'node.content_overview', 'parent' => 'system.admin', 'description' => 'Find and manage content.', + 'weight' => -10, ); $links['node.admin.structure.types'] = array( diff --git a/core/modules/system/system.module b/core/modules/system/system.module index ed0efba..5e07e2c 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -856,6 +856,7 @@ function system_menu_link_defaults() { 'parent' => 'system.admin', 'description' => 'Administer settings.', 'route_name' => 'system.admin_config', + 'weight' => 0, ); // Media settings. diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 0b13fc5..d0dbcc5 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -814,14 +814,7 @@ function user_menu_link_defaults() { 'route_name' => 'user.admin_account', 'description' => 'Manage user accounts, roles, and permissions.', 'parent' => 'system.admin', - 'weight' => -4, - ); - // Permissions and role forms. - $links['user.admin.people.permissions'] = array( - 'link_title' => 'Permissions', - 'parent' => 'user.admin.people', - 'description' => 'Determine access to features by selecting permissions for roles.', - 'route_name' => 'user.admin_permissions', + 'weight' => 4, ); // Administration pages.