=== modified file 'includes/common.inc' --- includes/common.inc 2009-09-25 15:20:12 +0000 +++ includes/common.inc 2009-09-30 06:14:43 +0000 @@ -3989,6 +3989,7 @@ function drupal_system_listing($mask, $d * hook_$type_alter functions. */ function drupal_alter($type, &$data) { + global $theme, $base_theme; // PHP's func_get_args() always returns copies of params, not references, so // drupal_alter() can only manipulate data that comes in via the required first // param. For the edge case functions that must pass in an arbitrary number of @@ -4016,7 +4017,9 @@ function drupal_alter($type, &$data) { array_shift($additional_args); $args = array_merge($args, $additional_args); - foreach (module_implements($type . '_alter') as $module) { + drupal_theme_initialize(); + $bases = array_merge(module_implements($type . '_alter'), array($theme), $base_theme); + foreach ($bases as $module) { $function = $module . '_' . $type . '_alter'; call_user_func_array($function, $args); } === modified file 'includes/theme.inc' --- includes/theme.inc 2009-09-21 06:36:54 +0000 +++ includes/theme.inc 2009-09-30 06:13:53 +0000 @@ -41,7 +41,7 @@ define('MARK_UPDATED', 2); * Initialize the theme system by loading the theme. */ function drupal_theme_initialize() { - global $theme, $user, $custom_theme, $theme_key; + global $theme, $user, $custom_theme, $theme_key, $base_theme; // If $theme is already set, assume the others are set, too, and do nothing if (isset($theme)) { @@ -69,7 +69,8 @@ function drupal_theme_initialize() { $base_theme[] = $new_base_theme = $themes[$themes[$ancestor]->base_theme]; $ancestor = $themes[$ancestor]->base_theme; } - _drupal_theme_initialize($themes[$theme], array_reverse($base_theme)); + $base_theme = array_reverse($base_theme); + _drupal_theme_initialize($themes[$theme], $base_theme); } /**