diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module index 288476119356..b2e36a1f087d 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu/menu.module @@ -198,7 +198,7 @@ function menu_theme() { * Add a link for each custom menu. */ function menu_enable() { - drupal_container()->get('router.builder')->rebuild(); + Drupal::service('router.builder')->rebuild(); menu_router_rebuild(); $system_link = entity_load_multiple_by_properties('menu_link', array('link_path' => 'admin/structure/menu', 'module' => 'system')); $system_link = reset($system_link); @@ -247,7 +247,7 @@ function menu_menu_insert(Menu $menu) { menu_cache_clear_all(); // Invalidate the block cache to update menu-based derivatives. if (module_exists('block')) { - drupal_container()->get('plugin.manager.block')->clearCachedDefinitions(); + Drupal::service('plugin.manager.block')->clearCachedDefinitions(); } // Make sure the menu is present in the active menus variable so that its // items may appear in the menu active trail. @@ -270,7 +270,7 @@ function menu_menu_update(Menu $menu) { menu_cache_clear_all(); // Invalidate the block cache to update menu-based derivatives. if (module_exists('block')) { - drupal_container()->get('plugin.manager.block')->clearCachedDefinitions(); + Drupal::service('plugin.manager.block')->clearCachedDefinitions(); } } @@ -299,7 +299,7 @@ function menu_menu_delete(Menu $menu) { // Invalidate the block cache to update menu-based derivatives. if (module_exists('block')) { - drupal_container()->get('plugin.manager.block')->clearCachedDefinitions(); + Drupal::service('plugin.manager.block')->clearCachedDefinitions(); } } diff --git a/core/modules/menu_link/lib/Drupal/menu_link/Plugin/Core/Entity/MenuLink.php b/core/modules/menu_link/lib/Drupal/menu_link/Plugin/Core/Entity/MenuLink.php index e9b2cd76e275..f32844f3c802 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/Plugin/Core/Entity/MenuLink.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/Plugin/Core/Entity/MenuLink.php @@ -292,7 +292,7 @@ class MenuLink extends Entity implements \ArrayAccess, MenuLinkInterface { return NULL; } if (!($this->routeObject instanceof Route)) { - $route_provider = drupal_container()->get('router.route_provider'); + $route_provider = \Drupal::service('router.route_provider'); $this->routeObject = $route_provider->getRouteByName($this->route_name); } return $this->routeObject;