TL;DR
Moving an XML configuration block from one module to another seems that the old one is cached somewhere (not in the Magento cache silly!!).
How and why?
I've just encountered a strange problem while testing our changes for the SUPEE 6788 patch. Here's the scenario:
We used to have a local module which was old and had a bunch of dodgy stuff in it. We also have another local module which is for the same area but newer and safe.
While fixing routes and doing all that fun stuff, I moved a Product_List block from Namespace_OldModule
to Namespace_NewModule
, and took the rewrite configuration from the old config.xml to the new one.
No problems until we deployed this to test in an environment using Redis for cache and Akamai for frontend CDN - the category lists were all blank (no products) and a PHP error was in the source code:
Fatal error: Call to a member function getLoadedProductCollection() on a non-object in /.../app/code/core/Enterprise/GoogleAnalyticsUniversal/Block/List/Json.php on line 130
Debugging that method, the method $this->getListBlock()
returns bool false. I then noticed that an exception in the logs said the following:
2015-11-09T20:27:20+00:00 ERR (3):
exception 'Mage_Core_Exception' with message 'Invalid block type: Namespace_OldModule_Block_Product_List' in /.../app/Mage.php:595
Stack trace:
#0 /.../app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid block t...')
#1 /.../app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('catalog/product...', Array)
#2 /.../app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('catalog/product...', 'product_list')
#3 /.../app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('catalog/product...', 'product_list')
So I checked the changes to the XML, and this component:
<global>
<blocks>
<catalog>
<rewrite>
<product_list>Namespace_NewModule_Block_Product_List</product_list>
</rewrite>
</catalog>
</blocks>
</global>
... had been moved from Namespace/OldModule/etc/config.xml
to Namespace/NewModule/etc/config.xml
- the only difference being the contents of the tag where the module name changed.
This must have been cached somewhere, because if I add a shortcut class back in place of where it's looking to extend the new one - no problem. The old module isn't referenced anywhere, I've checked. Also the cache has been cleared many times, php-fpm and nginx restarted (hard restart, not just gracefully) and cache busting etc.
# File: app/code/local/Namespace/OldModule/Block/Product/List.php
<?php
class Namespace_OldModule_Block_Product_List extends Namespace_NewModule_Block_Product_List
{
}
Can anyone explain to me why this might be happening?