Issue #2181151 by dawehner, tim.plunkett, InternetDevels, botanic_spark: Remove router rebuild from menu_ui.install

8.1.x
Nathaniel Catchpole 2016-01-21 18:10:37 +09:00
parent 01b3613b24
commit 3a27d38fb1
3 changed files with 6 additions and 25 deletions

View File

@ -56,6 +56,8 @@ class MenuLinkContentDeleteFormTest extends WebTestBase {
$this->assertLinkByHref($menu_link->url('edit-form'));
\Drupal::service('module_installer')->install(['menu_ui']);
\Drupal::service('router.builder')->rebuild();
// Make sure cancel URL points to menu_ui route now.
$this->drupalGet($menu_link->urlInfo('delete-form'));
$menu = Menu::load($menu_link->getMenuName());

View File

@ -1,25 +0,0 @@
<?php
/**
* @file
* Install, update and uninstall functions for the menu_ui module.
*/
/**
* Implements hook_install().
*/
function menu_ui_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://www.drupal.org/node/2181151
\Drupal::service('router.builder')->rebuild();
}
/**
* Implements hook_uninstall().
*/
function menu_ui_uninstall() {
\Drupal::service('router.builder')->setRebuildNeeded();
}

View File

@ -32,6 +32,10 @@ function standard_install() {
$user->roles[] = 'administrator';
$user->save();
// We install some menu links, so we have to rebuild the router, to ensure the
// menu links are valid.
\Drupal::service('router.builder')->rebuildIfNeeded();
// Enable the Contact link in the footer menu.
/** @var \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager */
$menu_link_manager = \Drupal::service('plugin.manager.menu.link');