1

One of our clients is running a Magento site that experiences intermittent problems where the home-page half-loads occasionally.

Investigating /var/log/httpd/error_log reveals the following which appears to be the source of the problem:

[Sat Feb 28 21:05:45 2015] [error] [client ###.###.#.###] PHP Fatal error:  Class 'Mage_Catalog_Model_Product' not found in /var/www/html/app/code/local/TM/Highlight/Block/Product/Abstract.php on line 40

The culprit code block in /local/TM/Highlight/Block/Product/Abstract.php is:

    $this->addData(array(
        'cache_lifetime'    => 86400,
        'cache_tags'        => array(Mage_Catalog_Model_Product::CACHE_TAG),
    ));

I've had a quick look at the documentation for the Mage_Catalog_Model_Product class and it does seem that class exists and so does the constant CACHE_TAG.

What's going on here? Is it a bug in this Abstract.php (which has come from Templates-Master at http://www.templates-master.com)? Is the Mage_Catalog_Model_Product class magically being loaded sometimes and not loaded other times for some reason?

1 Answer 1

0

Did you check if you compilation is enabled and is correctly build?

Maybe a conflict with some other installed modules? You could(on a test environment) disable some modules/cache/compilation and enable developermodus to investigate further.

Maybe you installed a module which adds some magic to the existing autoloader.

4
  • Thanks Jeroen Boersma. I'm relatively new to Magento. How would I go about checking compilation is enabled/correctly built? The odd thing is that the error seems to occur sometimes, but not others. Currently, the error is not triggering, but it was a couple hours ago. Could it be related to PHP running out of memory or something like that? Mar 1, 2015 at 21:45
  • Found php -f compiler.php enable and some more reading here: alanstorm.com/magento_compiler_path Mar 2, 2015 at 6:17
  • Output from php -f compiler.php state is Compiler Status: Disabled and Compilation State: Compiled Mar 2, 2015 at 6:19
  • Did php -f compiler.php clear, php -f compiler.php recompile and php -f compiler.php enable. The issue has gone away completely now! Mar 6, 2015 at 4:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.