commit 99669bffc71dbe0d7eb7cd1517acc8bfc55ca7e2 Author: Joel Pittet Date: Fri Jul 25 23:34:23 2014 -0700 undo that installer bit diff --git a/core/lib/Drupal/Core/CoreServiceProvider.php b/core/lib/Drupal/Core/CoreServiceProvider.php index 42c7dea..c41a1a0 100644 --- a/core/lib/Drupal/Core/CoreServiceProvider.php +++ b/core/lib/Drupal/Core/CoreServiceProvider.php @@ -84,6 +84,11 @@ public static function registerTwig(ContainerBuilder $container) { ->addArgument(DRUPAL_ROOT); $container->setAlias('twig.loader', 'twig.loader.filesystem'); + $twig_extension = new Definition('Drupal\Core\Template\TwigExtension'); + // When in the installer these services are not yet available. + if (!drupal_installation_attempted()) { + $twig_extension->addMethodCall('setGenerators', array(new Reference('url_generator'))); + } $container->register('twig', 'Drupal\Core\Template\TwigEnvironment') ->addArgument(new Reference('twig.loader')) ->addArgument(array( @@ -99,7 +104,7 @@ public static function registerTwig(ContainerBuilder $container) { )) ->addArgument(new Reference('module_handler')) ->addArgument(new Reference('theme_handler')) - ->addMethodCall('addExtension', array(new Definition('Drupal\Core\Template\TwigExtension'))) + ->addMethodCall('addExtension', array($twig_extension)) // @todo Figure out what to do about debugging functions. // @see http://drupal.org/node/1804998 ->addMethodCall('addExtension', array(new Definition('Twig_Extension_Debug')))