Magento Forum

Call to undefined method Mage_Catalog_Model_Resource_Product_Flat::getType()
 
boldt
Jr. Member
 
Total Posts:  4
Joined:  2011-04-11
 

Hi,

When we run our plugin on a customers magento shop running, 1.6.2 we get the following error.

<br />
<
b>Fatal error</b>:  Call to undefined method Mage_Catalog_Model_Resource_Product_Flat::getType() in <b>/home/users/horfiftp/horecaapparatuur.nl/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php</bon line <b>424</b><br />

What we basically do is to read products out from the shop like

$collection Mage::getModel(\'catalog/product\')->setStoreId(0)->getCollection()->joinAttribute(\'status\'\'catalog_product/status\'\'entity_id\'null\'inner\'0);
        
$collection2 Mage::getModel(\'catalog/product\')->setStoreId(0)->getCollection()->joinAttribute(\'status\'\'catalog_product/status\'\'entity_id\'null\'inner\'0);
        
        if( 
$order_by && array_key_exists$order_by$dict) ){
            $direction
=strtoupper($direction);
            
$collection->setOrder($dict[$order_by],$direction);
        
}
        
        $collection
->addAttributeToSelect(Mage::getSingleton(\'catalog/config\')->getProductAttributes());

..

        
$total=$collection2->count();
        
$collection->getSelect()->limit$perPage == null $total $perPage ,$offset);

the plugin works in 1.6.1, 1.5.x and 1.4.x so I have a suspicion that it is some special configuration of this shop that is the cause.

Why is this method Call to undefined method Mage_Catalog_Model_Resource_Product_Flat::getType() called. We don\’t have any explicit calls to this method in our code

Best Regards
Niels

 
Magento Community Magento Community
Magento Community
Magento Community
 
Spyyy
Jr. Member
 
Total Posts:  12
Joined:  2012-10-28
 

Have you found solution?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Siggi_Schmitz
Enthusiast
 
Avatar
Total Posts:  811
Joined:  2011-07-03
 

You call the function addAttributeToSelect in the file app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php which calls $this->getEntity()->getType() in the second line.

Compare the addAttributeToSelect function with the version in older magento versions where your extension runs. Maybe you see the difference and you have to change one ore more parameters from your addAttributeToSelect - call.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top