BUG : Magento 1.9.2.0 CE Static Block Cache Bug

created July 21, 2015, last updated August 18, 2015.

.
closeThis post was last updated 2 years 6 months 22 days ago, some of the information contained here may no longer be actual and any referenced software versions may have been updated!

NOTE – this bug was patched in MAGE 1.9.2.1

If you upgraded Magento to version 1.9.2 to fix the recent (July 2015) security vulnerabilities your Magento shop now has a bug affecting static blocks.

Magento CE 1.9.2.0 released on the 7th of July 2015 introduced a bug that causes cached static cms blocks to display incorrectly. An error in the Core application code caches the static block data with a non unique cache identifier. This means that the first static block to be cached will quite likely then be displayed when further static blocks are requested from cache resulting in the wrong content being displayed.

This bug has been registered with Magento as issue number 7817 and as of the time of writing an official patch has not been issued.

The Magento community responded to the issue coming up with various workarounds and fixes, the simplest of which is to disable the Blocks/Html output cache in Magento. There is also code available to extend and patch the offending Magento core code as well as a free module that modifies the cache keys used for static blocks via an observer that I have confirmed fixes the behaviour caused by the bug.

Disable magento block output cache

So what should you do? If you can disable the blocks HTML output cache and wait for the official patch from Magento then this is an acceptable short term quick fix that will resolve the problem.

In the long term, until a Magento patch is released and keeping all your caches enabled is important to you then install and test the Rkt_Sbcache module. It implements the workarounds discussed by the community changing the cache key of static blocks via an observer.

Install Rkt_Sbcache with modman : modman clone https://github.com/gaiterjones/Rkt_SbCache.git

This bug highlights the importance of testing new release code and the benefits of waiting for an incremental release of an update before upgrading. It also stresses the importance of thorough testing with a system that mirrors your live environment. I thought I had tested this version thoroughly, but I did all my testing on a development server with caching disabled and whilst I did test on a staging server with caching enabled I was not thorough enough to identify the duplication of static blocks – doh!

It is reassuring to know that the community is actively supporting Magento and that for CE users information is readily available to help workaround or fix a bug like this.

Resources

 

 

 

Comments

  1. Dave says:

    I tried the above no official patch and it broke my site gave me blank pages, guess I will have to wait and disable cache for page blocks for the moment, not really ideal. But thanks for trying.

    • PAJ says:

      I haven’t noticed (yet) any problems with Rkt_SbCache. Raise an issue with the developer on his git page, I am sure he will respond to you.