[development] $custom_theme when does it take effect... when doesit not

Jon Saints saintsjd at gmail.com
Fri Aug 15 18:30:17 UTC 2008

> IMO this is not a bug in block module; it's a bug in whatever is calling
> theme() or init_theme() before block module has a chance to set
> custom_theme.

Interesting. I added


to init_theme() after the if(isset($theme)) section and found that the
first functiont that calls init_theme().  As best I can tell,
system_init() (system.module around line 700) is the first function to
call theme() function.  It is the reason that the block module cannot
change the theme later on.

backtrace looks like this:
init_theme() -> theme() -> system_init() -> call_user_func_array() ->
module_invoke_all() -> _drupal_bootstrap_full() -> _drupal_bootstrap()
-> drupal_bootstrap()

I am not sure the problem is with system_init().  Shouldn't the block
module just use a hook_init() instead?


More information about the development mailing list