In case main site theme and administration theme are different, invalid theme for blocks administration page can be chosen. This happens if there are modules in drupal project that need to initialize theme (call init_theme()) from hook_init(). For example, see module Popups API.
Despite the fact that init_theme() DOES support global $custom_theme variable, block module changes its value for administrion page only in menu callback. So if init_theme() is called from hook_init() it uses $custom_theme defined by module system that is administration theme and not default theme for the site.
Solution: move $custom_theme from menu callback block_admin_display() to hook_init() and change block weight in order block_init() run after system_init()
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | block.patches.zip | 1.18 KB | ogorun |
Comments
Comment #1
ogorun commentedPatches with these changes.
Comment #2
chiddicks commentedI think I may be experiencing this issue. I use Admin Menu to specify Garland as the admin theme and have another theme as the default theme. When I go to the Block configuration page (admin/build/block) I am supposed to see the block configuration for my default theme, but I see the configuration for Garland. There's no way to get to the block configuration for my default theme.
I'd appreciate if you could reroll these patches in the standard format (http://drupal.org/patch/create) because I had some difficulty applying them. They did not fix the issue but I'm not convinced that the patches actually applied correctly.
Comment #3
ogorun commentedComment #4
thedavidmeister commentedPlease don't upload patches in .zip format to an issue thread if you want them to be reviewed by other contributors.
I don't think this will be fixed in D6 as we're generally only doing security fixes there. Feel free to re-open against D7+ if this is still an issue in more modern versions of Drupal.
Comment #5
thedavidmeister commentedsorry, just meant to postpone to see if this is still a bug in D7.
Comment #6
igor.ro commentedI do not like idea with init hook and weight.
I suggest this patch.