diff -u b/core/includes/menu.inc b/core/includes/menu.inc --- b/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -2696,6 +2696,10 @@ $link['customized'] = $existing_item->customized; $link['updated'] = $existing_item->updated; $menu_link = $menu_link_controller->create($link); + + // Convert the existing item to a typed object. + $existing_item = $menu_link_controller->create(get_object_vars($existing_item)); + if (!$existing_item->customized) { // A change in hook_default_menu_links may move the link to a // different menu. @@ -2703,6 +2707,7 @@ $menu_link->plid = NULL; $menu_link->menu_name = $link['menu_name']; } + $menu_link->original = $existing_item; } } @@ -2741,8 +2746,20 @@ } } - // @todo - remove links based on their machine names when module are - // uninstalled, or mark them disabled if the route names are missing? + // Find any item whose router path does not exist any more. + $query = \Drupal::entityQuery('menu_link') + ->condition('machine_name', array_keys($all_links), 'NOT IN') + ->condition('external', 0) + ->condition('updated', 0) + ->condition('customized', 0) + ->sort('depth', 'DESC'); + $result = $query->execute(); + + // Remove all such items. Starting from those with the greatest depth will + // minimize the amount of re-parenting done by the menu link controller. + if (!empty($result)) { + menu_link_delete_multiple($result, TRUE); + } } /** interdiff impossible; taking evasive action reverted: --- b/core/modules/system/system.install +++ a/core/modules/system/system.install @@ -2284,23 +2284,6 @@ } /** - * Add machine_name column to the menu_links table. - */ -function system_update_8061() { - $spec = array( - 'description' => 'Machine name: Optional human-readable ID for this link.', - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - ); - - db_add_field('menu_links', 'machine_name', $spec); - // Do away with the field that joins to the old {menu_router}. - db_drop_index('menu_links', 'router_path'); - db_drop_field('menu_links', 'router_path'); -} - -/** * @} End of "defgroup updates-7.x-to-8.x". * The next series of updates should start at 9000. */ unchanged: --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -2293,6 +2293,23 @@ function system_update_8060() { } /** + * Add machine_name column to the menu_links table. + */ +function system_update_8061() { + $spec = array( + 'description' => 'Machine name: Optional human-readable ID for this link.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => FALSE, + ); + + db_add_field('menu_links', 'machine_name', $spec); + // Do away with the field that joins to the old {menu_router}. + db_drop_index('menu_links', 'router_path'); + db_drop_field('menu_links', 'router_path'); +} + +/** * @} End of "defgroup updates-7.x-to-8.x". * The next series of updates should start at 9000. */ diff -u b/core/modules/system/system.routing.yml b/core/modules/system/system.routing.yml --- b/core/modules/system/system.routing.yml +++ b/core/modules/system/system.routing.yml @@ -340,6 +340,8 @@ '': path: '/' + defaults: + _title: Home requirements: _access: 'TRUE' only in patch2: unchanged: --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2140,6 +2140,13 @@ function template_preprocess_html(&$variables) { 'name' => String::checkPlain($site_config->get('name')), ); } + // @todo Remove once views is not bypassing the view subscriber anymore. + elseif (drupal_is_front_page()) { + $head_title = array( + 'title' => t('Home'), + 'name' => String::checkPlain($site_config->get('name')), + ); + } else { $head_title = array('name' => String::checkPlain($site_config->get('name'))); if ($site_config->get('slogan')) { only in patch2: unchanged: --- a/core/modules/toolbar/toolbar.module +++ b/core/modules/toolbar/toolbar.module @@ -551,7 +551,7 @@ function toolbar_get_rendered_subtrees() { $subtree = ''; } - $id = str_replace(array('/', '<', '>'), array('-', '', ''), $item['href']); + $id = str_replace(array('/', '<', '>'), array('-', '', ''), $item['link_path']); $subtrees[$id] = $subtree; } }