I was about to roll out a new module, and I started getting this error on the front end. Products will not display. They show the product name, then the page rendering fails and the error message appears:
Fatal error: Call to a member function getSummaryHtml() on a non-object in /usr/local/apache2/htdocs/app/code/core/Mage/Catalog/Block/Product/Abstract.php on line 314
This function in the Magento Core library is as follows:
public function getReviewsSummaryHtml(Mage_Catalog_Model_Product $product, $templateType = false,
$displayIfNoReviews = false)
{
if ($this->_initReviewsHelperBlock()) {
return $this->_reviewsHelperBlock->getSummaryHtml($product, $templateType, $displayIfNoReviews);
}
return '';
}
Line 314 is the ' return $this->... ' statement.
If I comment out this line, the site appears to run fine.
My scripts perform product price and other attribute updates. It also adds products if they are not found in the database. My concern is that my import script isn't updating part of the product model correctly, and creating this error.
My module is built in /app/code/local, and deals exclusively with the backend. I dropped the entire database and restored it to a known-to-be-solid version. Therefore, I believe I may have accidentally deleted a file or in some way changed Magento's core functionality. This is on the dev server. On the live server, the same database runs just fine.
Everything was fine, the only recent files that I removed were in my custom module's specific design and code directories.
I have cleared the caches, reindexed everything, dropped the database and restored a known working version, the only thing left seems to be the codebase is somehow changed.
I am about to roll out my admin module, but I do not want to do that until I know what is wrong here. Commenting out a line of Magento Core code on my live server seems like a hack fix.