diff --git a/includes/registry.inc b/includes/registry.inc index c0039ef9f887d8428858e701b4b52c622f4782c5..263f8ae8afcfb75537c40352febc2d42f76a40f8 100644 --- a/includes/registry.inc +++ b/includes/registry.inc @@ -229,9 +229,6 @@ function _bootstrap_process_theme_registry(array &$registry, $themes) { // File to be included by core's theme function when a theme hook is // invoked. if (isset($registry[$hook])) { - if (!isset($registry[$hook][$phase_key])) { - $registry[$hook][$phase_key] = array(); - } if (!isset($registry[$hook]['includes'])) { $registry[$hook]['includes'] = array(); } @@ -252,6 +249,11 @@ function _bootstrap_process_theme_registry(array &$registry, $themes) { // Iterate over each registered hook. foreach ($registry as $hook => $info) { + // Ensure the current phase callback functions array exists. + if (!isset($registry[$hook][$phase_key])) { + $registry[$hook][$phase_key] = array(); + } + // Remove function callbacks if a template was found. if (isset($info['function']) && isset($info['template'])) { unset($registry[$hook]['function']);