Commit 8a929920 authored by Dries's avatar Dries
Browse files

- Patch #252430 by quicksketch: allow base theme prefix in preprocessor...

- Patch #252430 by quicksketch: allow base theme prefix in preprocessor function names to correct expected behavior.
parent 253c74d2
...@@ -262,8 +262,8 @@ function drupal_theme_rebuild() { ...@@ -262,8 +262,8 @@ function drupal_theme_rebuild() {
/** /**
* Process a single invocation of the theme hook. $type will be one * Process a single invocation of the theme hook. $type will be one
* of 'module', 'theme_engine' or 'theme' and it tells us some * of 'module', 'theme_engine', 'base_theme_engine', 'theme', or 'base_theme'
* important information. * and it tells us some important information.
* *
* Because $cache is a reference, the cache will be continually * Because $cache is a reference, the cache will be continually
* expanded upon; new entries will replace old entries in the * expanded upon; new entries will replace old entries in the
...@@ -329,7 +329,7 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) { ...@@ -329,7 +329,7 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) {
// to provide preprocess functions even if they are not the owner of the current hook. // to provide preprocess functions even if they are not the owner of the current hook.
$prefixes += module_list(); $prefixes += module_list();
} }
elseif ($type == 'theme_engine') { elseif ($type == 'theme_engine' || $type == 'base_theme_engine') {
// Theme engines get an extra set that come before the normally named preprocessors. // Theme engines get an extra set that come before the normally named preprocessors.
$prefixes[] = $name . '_engine'; $prefixes[] = $name . '_engine';
// The theme engine also registers on behalf of the theme. The theme or engine name can be used. // The theme engine also registers on behalf of the theme. The theme or engine name can be used.
...@@ -388,7 +388,7 @@ function _theme_build_registry($theme, $base_theme, $theme_engine) { ...@@ -388,7 +388,7 @@ function _theme_build_registry($theme, $base_theme, $theme_engine) {
// Process each base theme. // Process each base theme.
foreach ($base_theme as $base) { foreach ($base_theme as $base) {
// If the theme uses a theme engine, process its hooks. // If the base theme uses a theme engine, process its hooks.
$base_path = dirname($base->filename); $base_path = dirname($base->filename);
if ($theme_engine) { if ($theme_engine) {
_theme_process_registry($cache, $theme_engine, 'base_theme_engine', $base->name, $base_path); _theme_process_registry($cache, $theme_engine, 'base_theme_engine', $base->name, $base_path);
......
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