diff -u b/core/includes/menu.inc b/core/includes/menu.inc --- b/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -2740,6 +2740,9 @@ } // Find any item whose router path does not exist any more. + // Do not delete entries with an empty path as this can remove menu links in + // the process of being created. + $paths[] = ''; $query = \Drupal::entityQuery('menu_link') ->condition('router_path', $paths, 'NOT IN') ->condition('external', 0) reverted: --- b/core/profiles/standard/standard.install +++ a/core/profiles/standard/standard.install @@ -51,7 +51,6 @@ 'link_path' => '', 'menu_name' => 'main', )); - menu_router_rebuild(); $menu_link->save(); // Enable the Contact link in the footer menu. only in patch2: unchanged: --- a/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php @@ -542,7 +542,7 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { } // Find the route_name. if (!isset($this->route_name)) { - if ($result = \Drupal::service('router.matcher.final_matcher')->findRouteNameParameters($this->link_path)) { + if (!$this->external && $result = \Drupal::service('router.matcher.final_matcher')->findRouteNameParameters($this->link_path)) { list($this->route_name, $this->route_parameters) = $result; } else {