summaryrefslogtreecommitdiff
path: root/includes/theme.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/theme.inc')
-rw-r--r--includes/theme.inc9
1 files changed, 7 insertions, 2 deletions
diff --git a/includes/theme.inc b/includes/theme.inc
index ca0e533aa..736662db6 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -251,13 +251,18 @@ function _theme_load_registry($theme, $base_theme = NULL, $theme_engine = NULL)
$cache = cache_get("theme_registry:$theme->name", 'cache');
if (isset($cache->data)) {
$registry = $cache->data;
+ _theme_set_registry($registry);
}
else {
// If not, build one and cache it.
$registry = _theme_build_registry($theme, $base_theme, $theme_engine);
- _theme_save_registry($theme, $registry);
+ // Only persist this registry if all modules are loaded. This assures a
+ // complete set of theme hooks.
+ if (drupal_get_bootstrap_phase() == DRUPAL_BOOTSTRAP_FULL) {
+ _theme_save_registry($theme, $registry);
+ _theme_set_registry($registry);
+ }
}
- _theme_set_registry($registry);
}
/**