1) enable all of drupal's themes.
2) add a custom block
3) goto admin/blocks, enable the block on all themes.
4) switch theme to another theme and goto the blocks admin page.

the block will not be enabled. You can closely observe what is going on in the blocks table.
SELECT theme, module, delta, status FROM blocks where module='block';

It appears that only the 'current' theme is updated from the blocks administration UI and not the 'selected' theme.

CommentFileSizeAuthor
#3 block_admin.patch588 bytesjmiccolis
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

killes@www.drop.org’s picture

Version: 4.7.3 » 5.x-dev

this is indeed rather confusing. If I select another theme's block admin screen, I also get to see all the regions defined, not only the ones for the selected theme.

ChrisKennedy’s picture

Version: 5.x-dev » 4.7.x-dev

I tried the behavior reported in the description and it doesn't occur in 5.x

jmiccolis’s picture

Status: Active » Needs review
FileSize
588 bytes

It appears that the problem here is how the $theme_key global is used by _block_rehash();

To me it looks like this could be fixed just by setting the $theme_key global based on the url, so that when _block_rehash is called it knows what theme to work with.

Patch is attached.

greggles’s picture

I couldn't repeat the problem as described using the Dev version from December 20, 2006 - 20:05 with block.module ID: 1.206.2.7

In step 4 when you say "switch" does that mean "visit admin/themes, make one of the currently enabled themes the default" or does it mean "visit user/uid/edit and change the theme for your user"?

I tried both scenarios but couldn't get repeat the problem.

jmiccolis - I assume you repeated the problem before creating your patch, right?

Caleb G2’s picture

Can not replicate issue on fresh install of 4.7 head. Seems to be fixed.

jmiccolis’s picture

Status: Needs review » Closed (fixed)

For me at least this seems to at base have been caused by a contrib module calling a theme function to early. Setting to Closed.

greggles’s picture

And while I agree we should close this issue, anyone who still has this issue should please continue trying to hunt down what combination of settings/contrib modules causes it.