Skip to main content

Drupal Patches

Drupal 6 Block Cache Mode Patch Module

Overview

Drupal 6 has a long-standing bug in the block module (as of 5/10/2011). This bug affects block caching mechanisms. The bug manifests itself if you have block caching enabled.

Once a module's blocks have been registered with the system (in the {blocks} table), the block's caching mode settings are never updated in the {blocks} table, regardless of subsequent cache flushes or other system updates. This is only a problem for modules that change the 'cache' info returned from hook_block op='list' calls.

Uninstalling and re-installing the module won't fix the problem due to another Drupal 6 bug.

More info

This problem impacts any module that changes the caching mode returned in hook_block('info') operation. In particular, the views module allows you to edit a block view's caching mode after creation, but, due to this bug, the changes will never take effect, leading to much head-scratching.

More info

The fix

There are a few core patches available (see Issue 235673, above), but they may not apply cleanly to your Drupal 6 installation; I don't patch core unless there's a critical need. In this case, the patches failed to apply on the sites that needed the fix. So I created a simple custom module that implements the guts of the most recent patch.

Note: You can download the module in the Attachments section, below. Leave a comment if you find this module useful, or, if you have questions about it.

Syndicate content