1

I have a magento admin grid module and when I am inside the grid on the admin menu it shows me the header and the add item button but it throws this error

Fatal error: Call to undefined method NAMESPACE_Garantiaextendida_Model_Mysql4_Garantiaextendida_Collection::setPageSize() in G:\xampp\htdocs\webpage\app\code\core\Mage\Adminhtml\Block\Widget\Grid.php on line 553

This is my mysql4 model collection

   <?php 

class Felisiakluciano_Garantiaextendida_Model_Mysql4_Garantiaextendida_Collection extends  Mage_Core_Model_Mysql4_Collection_Abstract
{
    protected function _construct()
    {
        $this->_init('garantiaextendida/garantiaextendida');
    }   
}

Can somebody help me? Please its more than urgent. Thanks and Good Bye.

1

Check if NAMESPACE_Garantiaextendida_Model_Mysql4_Garantiaextendida_Collection is extending the right core Magento abstract collection class that it is supposed to.

  • Many Thanks, that was the problem, i was extending the wrong class. Mage_Core_Model_Mysql4_Abstract instead of Mage_Core_Model_Mysql4_Collection_Abstract , again thanks and good luck! – lfelisiak Aug 24 '14 at 22:30
1

The collection you are calling is the cause. That is why you are having an error when calling setPageSize(). This can be caused by several things, here are a few to check: not declared model in config.xml, error in files inside Model, error when calling the collection with an incorrect name.

You can get a fully functional admin/backend extension from here and try to reuse it as a base.

  • Thanks for the quick answer, i will use that example as guide. – lfelisiak Aug 24 '14 at 22:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.