Вопрос

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?

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с magento.stackexchange
scroll top