diff -u b/core/includes/menu.inc b/core/includes/menu.inc --- b/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -2599,12 +2599,12 @@ } /** - * Finds all links returned from hook_menu_link_defaults(). + * Gets all default menu link definitions. * * @return array * An array of default menu links. */ -function menu_links_get_defaults() { +function menu_link_get_defaults() { $module_handler = \Drupal::moduleHandler(); $all_links = $module_handler->invokeAll('menu_link_defaults'); // Fill in the machine name from the array key. @@ -2618,19 +2618,20 @@ /** * Builds menu links for the items returned from hook_menu_link_defaults(). */ -function menu_links_rebuild_defaults() { +function menu_link_rebuild_defaults() { $module_handler = \Drupal::moduleHandler(); if (!$module_handler->moduleExists('menu_link')) { // The Menu link module may not be available during install, so rebuild // when possible. return; } - $menu_link_controller = \Drupal::entityManager() + /** @var \Drupal\menu_link\MenuLinkStorageControllerInterface $menu_link_storage */ + $menu_link_storage = \Drupal::entityManager() ->getStorageController('menu_link'); $links = array(); $children = array(); $top_links = array(); - $all_links = menu_links_get_defaults(); + $all_links = menu_link_get_defaults(); if ($all_links) { foreach ($all_links as $machine_name => $link) { // For performance reasons, do a straight query now and convert to a menu @@ -2649,10 +2650,11 @@ $link['uuid'] = $existing_item->uuid; $link['customized'] = $existing_item->customized; $link['updated'] = $existing_item->updated; - $menu_link = $menu_link_controller->createFromDefaultLink($link); + $menu_link = $menu_link_storage->createFromDefaultLink($link); // Convert the existing item to a typed object. - $existing_item = $menu_link_controller->create(get_object_vars($existing_item)); + /** @var \Drupal\menu_link\MenuLinkInterface $existing_item */ + $existing_item = $menu_link_storage->create(get_object_vars($existing_item)); if (!$existing_item->customized) { // A change in hook_menu_link_defaults() may move the link to a @@ -2670,7 +2672,7 @@ $link['route_name'] = ''; $link['link_title'] = 'THIS IS A BUG'; } - $menu_link = $menu_link_controller->createFromDefaultLink($link); + $menu_link = $menu_link_storage->createFromDefaultLink($link); } if (!empty($link['parent'])) { $children[$link['parent']][$machine_name] = $machine_name; @@ -2689,14 +2691,14 @@ } } foreach ($top_links as $machine_name) { - _menu_link_save_recursive($menu_link_controller, $machine_name, $children, $links); + _menu_link_save_recursive($menu_link_storage, $machine_name, $children, $links); } // Handle any children we didn't find starting from top-level links. foreach ($children as $orphan_links) { foreach ($orphan_links as $machine_name) { // Force it to the top level. $links[$machine_name]->plid = 0; - _menu_link_save_recursive($menu_link_controller, $machine_name, $children, $links); + _menu_link_save_recursive($menu_link_storage, $machine_name, $children, $links); } } diff -u b/core/modules/language/language.module b/core/modules/language/language.module --- b/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -100,7 +100,6 @@ 'description' => 'Configure languages for content and the user interface.', 'route_name' => 'language.admin_overview', 'parent' => 'system.admin.config.regional', - 'weight' => 0, ); // Content language settings. $links['language.admin.language.content_settings_page'] = array( @@ -108,7 +107,7 @@ 'description' => 'Configure language support for content.', 'route_name' => 'language.content_settings_page', 'parent' => 'system.admin.config.regional', - 'weight' => 0, + 'weight' => 10, ); return $links; diff -u b/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php b/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php --- b/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php @@ -365,9 +365,10 @@ // 'menu_name' are not stored anywhere else. Since resetting a link happens // rarely and this is a one-time operation, retrieving the full set of // default menu links does little harm. - $all_links = menu_links_get_defaults(); + $all_links = menu_link_get_defaults(); $original = $all_links[$this->machine_name]; $original['machine_name'] = $this->machine_name; + /** @var \Drupal\menu_link\MenuLinkStorageControllerInterface $storage_controller */ $storage_controller = \Drupal::entityManager()->getStorageController($this->entityType); $new_link = $storage_controller->createFromDefaultLink($original); // Merge existing menu link's ID and 'has_children' property. diff -u b/core/modules/system/system.module b/core/modules/system/system.module --- b/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -884,7 +884,6 @@ 'link_title' => 'Web services', 'parent' => 'system.admin.config', 'route_name' => 'system.admin_config_services', - 'weight' => 0, ); $items['system.admin.config.services.rss-publishing'] = array( 'link_title' => 'RSS publishing',