Commit c2b10295 authored by Dries's avatar Dries

- Patch #592008 by moshe weitzman, David_Rothstein, chx: don't save theme...

- Patch #592008 by moshe weitzman, David_Rothstein, chx: don't save theme registry before modules are included.
parent 36088732
......@@ -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();
......
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