Steps that produced this bug:
1) At admin/build/theme switched from theme 1 to theme 2: disabled theme 1, checked enable and default on theme 2.
2) Clicked save, saw custom blocks that were enabled in theme 1 active in $left and $right that were not displaying the data from the Block Title field
3) At admin/build/block clicked "configure" on one of the custom blocks that was missing its title
4) Confirmed that the block title text was still in the appropriate field, clicked "save" without making any changes.
5) Confirmed that the saved block's title now appeared in the theme where as the untouched block was still missing its title.

Enabling and making theme 1 default again (while disabling theme 2), and then switching in the same fashion back into theme 2 showed the saved block with title whereas the untouched block still did not have a title. It was as though the title only "registered" after the block was saved in that theme. The title would stick no matter what after it was saved within the theme in use.

It seems to me that when a theme inherits a block configuration it should also inherit the block titles. This was tested and reliably replicated on an install with no contributed modules enabled.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

markshust’s picture

i can confirm this error on a variety of third-party templates.

Kevin Danenberg’s picture

I am experiencing this problem with a Drupal 6.12 site when switching between two themes. Both custom themes have the same left and right sidebar regions as per typical Drupal sites. The second theme is a Ninesixty-based subtheme. They both have additional custom regions set in .info, and the second has some new regions, but they both have all the standard regions set.

When I switch from Theme 1 to Theme 2, some blocks display with missing titles, and other blocks disappear entirely.

I have to open each block for editing and save without making changes to restore each block properly. They are already set to the proper regions since the left and right sidebars are common to both themes.

If I then switch back to Theme 1, everything is fine. However, if I switch back to Theme 2, blocks and block titles disappear again, so I'm back at square one.

warmnoise’s picture

Version: 6.13 » 6.16
Component: block.module » system.module
FileSize
1.08 KB

It appears this can affect both standard and sub-themes, such as using the zen project.

During the first time that a theme is being enabled (I'm reproducing with 6.16), the theme gets a copy of the default theme's blocks.

See http://api.drupal.org/api/function/system_initialize_theme_blocks/

What is curious is that the INSERT statement does not include the "title" field. There may be a very good reason not to do this, but I'm investigating that. Please let me know if there is an obvious reason not to copy the title.

You can verify if your new block title values were not copied by using some simple SQL:

SELECT bid, module, delta, theme,title from {blocks} where theme = 'your_new_theme_systemname';

To get around this limitation, and to allow themers to continue work, I've just overridden system.module in a small module. All we are doing is adding the title update. See attached diff for testing.

You'll have to remove any entries in the block table for this new theme first using the following. You can now watch the system_initialize_theme_blocks() perform the INSERT again.

DELETE from {blocks} where theme = 'your_new_theme_systemname';

IMO, if the default theme's block title was blank, that is fine. We will still mirror that in the new theme.

warmnoise’s picture

Status: Active » Needs review

Updating to needs review. Open to any comments/rambling about the behavior of block titles during system_initialize_theme_blocks().

Status: Needs review » Needs work

The last submitted patch, system_initialize_theme_blocks-title.diff, failed testing.

warmnoise’s picture

Version: 6.16 » 6.x-dev
Status: Needs work » Needs review
FileSize
1.35 KB

Updated patch to 6.x HEAD for QA test.

warmnoise’s picture

Status: Needs review » Needs work
warmnoise’s picture

Status: Needs work » Needs review

Accidental previous status change. Awaiting new QA results.

thebuckst0p’s picture

Ran into this problem, subscribe.

warmnoise’s picture

QA resubmit. Up to HEAD with 6.x-dev.

warmnoise’s picture

FileSize
1.38 KB

For some reason, QA tests keep getting postponed. Possibility that filename with -6 extension for D6 specific HEAD is causing patch to to be queued. Trying again with basic name.

Status: Needs review » Needs work

The last submitted patch, system_521668.patch, failed testing.

ericpai’s picture

Version: 6.x-dev » 6.19

Subscribing. Same problem.

KrisBulman’s picture

experiencing the same problem as original poster, noticed it when developing sub themes of zen.

subscribing

KrisBulman’s picture

Version: 6.19 » 6.x-dev
FileSize
1.18 KB

retry of patch commit (same as above)

KrisBulman’s picture

Status: Needs work » Patch (to be ported)
FileSize
1.18 KB

*edit*

please ignore this, patch above was accepted (after being in ignore status for a day)

KrisBulman’s picture

Status: Patch (to be ported) » Needs review
FileSize
1.18 KB

*edit*

please ignore this, patch 2 posts above was accepted (after being in ignore status for a day)

Dood59’s picture

problem resolved on D7 I think

KrisBulman’s picture

no chance of resolving it in D6?

KrisBulman’s picture

could someone review & test the patch that passed QA testing?

burgs’s picture

Status: Needs review » Reviewed & tested by the community

This is definitely a bug, and this patch (#15) seems to fix it nicely. Thanks.

KrisBulman’s picture

are bug fixes still making it into 6.x releases?

xjm’s picture

Patch looks correct and straightforward.

joachim’s picture

> Patch looks correct and straightforward.

I agree. Can we have it committed please?

KrisBulman’s picture

#15: 521668-blocktitle-missing.patch queued for re-testing.

KrisBulman’s picture

Not sure why this didn't make it into the 6.25 bugfix release?

joachim’s picture

...or 6.26...

KrisBulman’s picture

joachim’s picture

hansfn’s picture

Just for the record: This patch is still not included in Drupal 6.30 so I guess it never will be.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 17: system_521668-blocktitlemissing-D6.patch, failed testing.

crystalidea’s picture

Issue summary: View changes

The isssue still reproduces in the latest version of drupal 6 (6.35)
The patch #15 does fix it

rooby’s picture

I have seen this problem on Drupal 7 also. I will try a fresh install to confirm.

Status: Needs work » 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.