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()

CommentFileSizeAuthor
#1 block.patches.zip1.18 KBogorun

Comments

ogorun’s picture

StatusFileSize
new1.18 KB

Patches with these changes.

chiddicks’s picture

I 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.

ogorun’s picture

Status: Active » Needs review
thedavidmeister’s picture

Status: Needs review » Closed (won't fix)

Please 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.

thedavidmeister’s picture

Status: Closed (won't fix) » Postponed (maintainer needs more info)

sorry, just meant to postpone to see if this is still a bug in D7.

igor.ro’s picture

I do not like idea with init hook and weight.

I suggest this patch.

Status: Postponed (maintainer needs more info) » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.