diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-04-06 17:56:40 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-04-06 17:56:40 +0000 |
commit | c2b1029595afe103b5f1533604cfe658755f1f8d (patch) | |
tree | f23a1adacaec52fc51463850c6cec5cb6f416440 /includes/theme.inc | |
parent | 36088732bb11e05ee4a14a3d1101615a1891f93f (diff) | |
download | brdo-c2b1029595afe103b5f1533604cfe658755f1f8d.tar.gz brdo-c2b1029595afe103b5f1533604cfe658755f1f8d.tar.bz2 |
- Patch #592008 by moshe weitzman, David_Rothstein, chx: don't save theme registry before modules are included.
Diffstat (limited to 'includes/theme.inc')
-rw-r--r-- | includes/theme.inc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/includes/theme.inc b/includes/theme.inc index b54f0bc13..2e5c691bd 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -764,6 +764,14 @@ function list_themes($refresh = FALSE) { */ function theme($hook, $variables = array()) { static $hooks = NULL; + + // If called before all modules are loaded, we do not necessarily have a full + // theme registry to work with, and therefore cannot process the theme + // request properly. See also _theme_load_registry(). + if (!module_load_all(NULL) && !defined('MAINTENANCE_MODE')) { + throw new Exception(t('theme() may not be called until all modules are loaded.')); + } + if (!isset($hooks)) { drupal_theme_initialize(); $hooks = theme_get_registry(); |