diff --git a/core/themes/engines/twig/twig.engine b/core/themes/engines/twig/twig.engine index 74de2b8..d596715 100644 --- a/core/themes/engines/twig/twig.engine +++ b/core/themes/engines/twig/twig.engine @@ -6,7 +6,6 @@ */ use Drupal\Core\Extension\Extension; -use Drupal\Component\Utility\Settings; /** * Implements hook_theme(). @@ -46,13 +45,14 @@ function twig_init(Extension $theme) { * The output generated by the template, plus any debug information. */ function twig_render_template($template_file, $variables) { + $twig_service = \Drupal::service('twig'); $output = array( 'debug_prefix' => '', 'debug_info' => '', - 'rendered_markup' => \Drupal::service('twig')->loadTemplate($template_file)->render($variables), + 'rendered_markup' => $twig_service->loadTemplate($template_file)->render($variables), 'debug_suffix' => '', ); - if (Settings::get('twig_debug', FALSE)) { + if ($twig_service->isDebug()) { $output['debug_prefix'] .= "\n\n"; $output['debug_prefix'] .= "\n"; // If there are theme suggestions, reverse the array so more specific diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php index ad2c404..3eac574 100644 --- a/sites/default/default.settings.php +++ b/sites/default/default.settings.php @@ -289,6 +289,9 @@ * - Twig templates are automatically recompiled whenever the source code * changes (see twig_auto_reload below). * + * Note: changes to this setting will only take effect once the cache is + * cleared. + * * For more information about debugging Twig templates, see * http://drupal.org/node/1906392. * @@ -303,6 +306,9 @@ * you don't provide a value for twig_auto_reload, it will be determined based * on the value of twig_debug. * + * Note: changes to this setting will only take effect once the cache is + * cleared. + * * Not recommended in production environments (Default: NULL). */ # $settings['twig_auto_reload'] = TRUE; @@ -315,6 +321,9 @@ * from source each time they are used. In most cases the twig_auto_reload * setting above should be enabled rather than disabling the Twig cache. * + * Note: changes to this setting will only take effect once the cache is + * cleared. + * * Not recommended in production environments (Default: TRUE). */ # $settings['twig_cache'] = FALSE;