diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-08-22 12:46:21 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-08-22 12:46:21 +0000 |
commit | b0894ceaa74c01444856910fd87dfc992542eb85 (patch) | |
tree | 5dbbd695351e7344279e27b32454beede85b53e2 /includes/common.inc | |
parent | ee691c593adfaf4c8046cf6ee2bc9796a28a1448 (diff) | |
download | brdo-b0894ceaa74c01444856910fd87dfc992542eb85.tar.gz brdo-b0894ceaa74c01444856910fd87dfc992542eb85.tar.bz2 |
- Patch #812016 by effulgentsia, chx, redndahead, Damien Tournoud: themes cannot always participate in drupal_alter().
Diffstat (limited to 'includes/common.inc')
-rw-r--r-- | includes/common.inc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/includes/common.inc b/includes/common.inc index 959675f8b..afb08eafd 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -4592,13 +4592,19 @@ function _drupal_bootstrap_full() { // Initialize $_GET['q'] prior to invoking hook_init(). drupal_path_initialize(); - // Set a custom theme for the current page, if there is one. We need to run - // this before invoking hook_init(), since any modules which initialize the - // theme system will prevent a custom theme from being correctly set later. - menu_set_custom_theme(); - // Let all modules take action before menu system handles the request + + // Let all modules take action before the menu system handles the request. // We do not want this while running update.php. if (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update') { + // Prior to invoking hook_init(), initialize the theme (potentially a custom + // one for this page), so that: + // - Modules with hook_init() implementations that call theme() or + // theme_get_registry() don't initialize the incorrect theme. + // - The theme can have hook_*_alter() implementations affect page building + // (e.g., hook_form_alter(), hook_node_view_alter(), hook_page_alter()), + // ahead of when rendering starts. + menu_set_custom_theme(); + drupal_theme_initialize(); module_invoke_all('init'); } } |