If the current theme is not the mail theme, mailsystem_theme_theme_registry_alter() alters the theme registry by loading the mail theme in addition to the current theme.
So when the cache is cleared and theme_a is active, drupal first initializes theme_a and additionally theme_b (our mail theme). Due to the fact that drupal_alter caches the available functions, out hook_alter functions in out theme_b's template.php (or theme_b's base theme) don't get called, because these functions weren't loaded when theme_a got initialized.
This leaves theme_b (our mail theme) in an initialized, but broken state, as none of the themes alter hooks have been loaded.


Status:Active» Needs review
new1.93 KB

Not 100% why mailsystem builds the mail theme registry when it's not the active theme but I won't question that and instead will give you this patch... I'm not convinced it's the completely proper way to fix this but it works for me with an Omega based subtheme.

new1.94 KB

Patch in #1 has a typo in, doesn't appear to affect anything except a PHP notice but here's a fixed patch.

Issue summary:View changes

Patch #2 solved same issue on a omega 4.x subtheme.
Thanks @mjpa

Version:7.x-2.34» 7.x-2.x-dev
new748 bytes
new2.53 KB

Patch #2 is working here, I'd RTBC it but I needed and additional fix for a related issue: my custom theme uses some functions from the base theme, which is currently loaded after the child causing a "function not found" fatal error to be thrown. If the interdiff looks good we can RTBC this.