Magento – Fix Fatal Error: Cannot Override Final Method Mage_Core_Model_Abstract::clearInstance()

MySQLPHP

I am getting the following error message:

Fatal error: Cannot override final method Mage_Core_Model_Abstract::clearInstance() in /var/www/html/app/code/core/Mage/Catalog/Model/Product.php on line 38 Warning: include(Mage.php): failed to open stream: No such file or directory in /var/www/html/lib/Varien/Autoload.php on line 93 Warning: include(): Failed opening 'Mage.php' for inclusion (include_path='/var/www/html/app/code/local:/var/www/html/app/code/community:/var/www/html/app/code/core:/var/www/html/lib:.:/usr/share/pear:/usr/share/php') in /var/www/html/lib/Varien/Autoload.php on line 93 Fatal error: Class 'Mage' not found in /var/www/html/app/code/core/Mage/Core/functions.php on line 244 Warning: include(Mage.php): failed to open stream: No such file or directory in /var/www/html/lib/Varien/Autoload.php on line 93 Warning: include(): Failed opening 'Mage.php' for inclusion (include_path='/var/www/html/app/code/local:/var/www/html/app/code/community:/var/www/html/app/code/core:/var/www/html/lib:.:/usr/share/pear:/usr/share/php') in /var/www/html/lib/Varien/Autoload.php on line 93 Fatal error: Class 'Mage' not found in /var/www/html/app/code/core/Mage/Core/Model/Resource/Session.php on line 108

Only the main page does not open anymore. If I open any product via direct URL or category it works! Magento Backend also works fine.

Does anybody have a clou? Google told me, that it could be a problem with APC Cache, but also with disabled APC it does not work.

Hope I can get some help here :-). Thanks!!

Best Answer

I think I fixed the issue by updating Magento to 1.8.0.1 and editing

app/code/core/Mage/Catalog/Block/Navigation.php line 254

from

$childrenCount = $children->count();

to

$childrenCount = count($children);

I can access the main page without any error message now!