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

Earl Miles merlin at logrus.com
Fri Aug 15 18:43:03 UTC 2008

Jon Saints wrote:
>> 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
> var_dump(debug_backtrace());
> exit();
> 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?
> Thanks
> Jon

Indeed, it appears that a theme() call was added in HEAD to init_theme().

To whomever added this: *THWAP* bad developer. No biscuit!

More information about the development mailing list