Commit 5bc43252 authored by paulocs's avatar paulocs Committed by paulocs

Issue #3170929 by paulocs, AaronBauman, justcaldwell, fishfin, andy-blum:...

Issue #3170929 by paulocs, AaronBauman, justcaldwell, fishfin, andy-blum: ContainerNotInitializedException: \Drupal::$container is not initialized yet
parent 246b98dd
......@@ -16,9 +16,8 @@ class ContextServiceProvider extends ServiceProviderBase {
*/
public function alter(ContainerBuilder $container) {
// Override the menu active trail with a new class.
$definition = \Drupal::service('menu.active_trail');
$definition = $container->getDefinition('menu.active_trail');
if (!is_subclass_of($definition, 'Drupal\Core\Menu\MenuActiveTrail') && $definition instanceof MenuActiveTrail) {
$definition = $container->getDefinition('menu.active_trail');
$definition->setClass('Drupal\context\ContextMenuActiveTrail');
$definition->addArgument($container->getDefinition('context.manager'));
}
......
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