I updated yesterday to 1.9 CE and now my category pages I get this fatal error:
Fatal error: Call to undefined method Mage_Catalog_Model_Resource_Category_Flat_Collection::joinUrlRewrite() in /home/senorehe/public_html/app/code/local/Mage/Catalog/Block/Navigation.php on line 155
This is the section it is referring to
public function getCurrentChildCategories()
{
$layer = Mage::getSingleton('catalog/layer');
$category = $layer->getCurrentCategory();
/* @var $category Mage_Catalog_Model_Category */
$collection = Mage::getModel('catalog/category')->getCollection();
/* @var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection */
$collection->addAttributeToSelect('url_key')
->addAttributeToSelect('name')
->addAttributeToSelect('is_anchor')
->addAttributeToSelect('image')
->addAttributeToFilter('is_active', 1)
->addIdFilter($category->getChildren())
->setOrder('position', 'ASC')
line 155 ->joinUrlRewrite()
->load();
$productCollection = Mage::getResourceModel('catalog/product_collection');
$layer->prepareProductCollection($productCollection);
$productCollection->addCountToCategories($collection);
return $collection;
}
I have tried reindexing the URL, flushing my mage_core_url_rewrite
then reindexing. But nothing had worked so far.
Can anybody help me with this?
SELECT url_key, COUNT(url_key) AS NumOccurrences FROM catalog_product_flat_1 GROUP BY url_key HAVING ( COUNT(url_key) > 1 );
And make sure you read the upgrade docs