Commit fada89f3 authored by webchick's avatar webchick

Issue #2011104 by tidrif | DmitryDrozdik: Replace drupal_container() with...

Issue #2011104 by tidrif | DmitryDrozdik: Replace drupal_container() with Drupal::service() in the menu & menu_link() modules.
parent 8bff939b
......@@ -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();
}
}
......
......@@ -292,7 +292,7 @@ public function getRoute() {
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment