Fix block cache

Bug #444902 reported by Pierre Buyle
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
UD Header
Fix Released
Medium
Michael Lustfield

Bug Description

By default, block content is cached per role (see http://api.drupal.org/hook_block).

When the UD Header block is retrieved from cache, the udheader_build_block function is not invokated and the udheader-style.css file is not added to the CSS. See http://drupal.org/node/214856

Also, when using t() to translate header text (as suggested in bug #443439), the translated content is cached for all languages.

Adding $block[0]['cache']=BLOCK_NO_CACHE in udheader_block() should disable cache for the UD Header and solve these issues.

Related branches

description: updated
Changed in ubuntu-drupal-header:
assignee: nobody → Michael Lustfield (mtecknology)
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Michael Lustfield (michaellustfield) wrote :

This is fixed in r21.

Changed in ubuntu-drupal-header:
status: In Progress → Fix Committed
Revision history for this message
Michael Lustfield (michaellustfield) wrote :

Instead of disabling the cache function, I added hook_init so the css will always be rendered with the block instead of after. This will ensure the cached version has the CSS as well.

summary: - Don't let header block be cached
+ Fix block cache
Revision history for this message
Pierre Buyle (mongolito404) wrote :

Blocks are not cached per page. If the UD Header block is cached for a node page with a type-specific header, next pages will use that specific header and not the default one.

Revision history for this message
Michael Lustfield (michaellustfield) wrote :

Thanks for letting me know. I used the exact line you gave me and tossed it out as r23.

Revision history for this message
Michael Lustfield (michaellustfield) wrote :

This fix has been merged into drupal.org.

Changed in ubuntu-drupal-header:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.