diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 19e3bab..3ce3fcc 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1041,9 +1041,6 @@ function theme($hook, $variables = array()) { // @todo Consider passing $original_hook as last argument. Drupal::moduleHandler()->alter($suggestion_hooks, $suggestions, $variables); - // Store array of suggestions in variables array. - $variables['theme_hook_suggestions'] = $suggestions; - // Check if each suggestion exists in the theme registry, and if so, // use it instead of the hook that theme() was called with. For example, a // function may call theme('node', ...), but a a module can add @@ -1147,7 +1144,7 @@ function theme($hook, $variables = array()) { if (isset($info['path'])) { $template_file = $info['path'] . '/' . $template_file; } - $output = $render_function($template_file, $variables); + $output = $render_function($template_file, $variables, $suggestions); } // restore path_to_theme() diff --git a/core/themes/engines/phptemplate/phptemplate.engine b/core/themes/engines/phptemplate/phptemplate.engine index 718d460..f451dff 100644 --- a/core/themes/engines/phptemplate/phptemplate.engine +++ b/core/themes/engines/phptemplate/phptemplate.engine @@ -42,7 +42,7 @@ function phptemplate_extension() { * @return * The output generated by the template. */ -function phptemplate_render_template($template_file, $variables) { +function phptemplate_render_template($template_file, $variables, $suggestions) { // Extract the variables to a local namespace extract($variables, EXTR_SKIP); diff --git a/core/themes/engines/twig/twig.engine b/core/themes/engines/twig/twig.engine index b541cdc..838aef0 100644 --- a/core/themes/engines/twig/twig.engine +++ b/core/themes/engines/twig/twig.engine @@ -46,7 +46,7 @@ function twig_init($template) { * @return * The output generated by the template, plus any debug information. */ -function twig_render_template($template_file, $variables) { +function twig_render_template($template_file, $variables, $suggestions) { $variables['_references'] = array(); $output = array( 'debug_prefix' => '', @@ -57,10 +57,9 @@ function twig_render_template($template_file, $variables) { if (settings()->get('twig_debug', FALSE)) { $output['debug_prefix'] .= "\n\n"; $output['debug_prefix'] .= "\n"; - if (!empty($variables['theme_hook_suggestions'])) { + if (!empty($suggestions)) { $extension = twig_extension(); $current_template = basename($template_file); - $suggestions = $variables['theme_hook_suggestions']; $suggestions[] = $variables['theme_hook_original']; foreach ($suggestions as $key => &$suggestion) { $template = strtr($suggestion, '_', '-') . $extension;