Issue #2011104 by tidrif | DmitryDrozdik: Replace drupal_container() with Drupal::service() in the menu & menu_link() modules.

8.0.x
webchick 2013-06-17 01:06:38 -05:00
parent 8bff939bfc
commit fada89f3c8
2 changed files with 5 additions and 5 deletions

View File

@ -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();
}
}

View File

@ -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;