Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 3
Invalid method Mage_Catalog_Block_Product_List_Toolbar::isLastPage(Array
 
freaxxx
Jr. Member
 
Total Posts:  2
Joined:  2010-07-08
 

Hi guys,

First of all sorry for my not so good English.
I have a stupid problem with my magento store.
I have 3 categories in my store, one with 10 products and the other 2 are empty.
When i am trying to add more products in the category with 10 products an error showed up.

Exception printing is disabled by default for security reasons.

I have renamed the local.xml.sample to local.xml in the error directory and this came up.

Invalid method Mage_Catalog_Block_Product_List_Toolbar::isLastPage(Array
(
)
)

Trace:
#0 [internal function]: Varien_Object->__call(\'isLastPage\', Array)
#1 /home/bgmannet/public_html/radari.com/app/design/frontend/blank/default/template/catalog/product/list/toolbar.phtml(69): Mage_Catalog_Block_Product_List_Toolbar->isLastPage()
#2 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Template.php(212): include(\'/home/bgmannet/...\')
#3 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Template.php(239): Mage_Core_Block_Template->fetchView(\'frontend/blank/...\')
#4 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Template.php(253): Mage_Core_Block_Template->renderView()
#5 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Abstract.php(753): Mage_Core_Block_Template->_toHtml()
#6 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Abstract.php(520): Mage_Core_Block_Abstract->toHtml()
#7 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Abstract.php(471): Mage_Core_Block_Abstract->_getChildHtml(\'toolbar\', true)
#8 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Catalog/Block/Product/List.php(182): Mage_Core_Block_Abstract->getChildHtml(\'toolbar\')
#9 /home/bgmannet/public_html/radari.com/app/design/frontend/blank/theme063/template/catalog/product/list.phtml(39): Mage_Catalog_Block_Product_List->getToolbarHtml()
#10 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Template.php(212): include(\'/home/bgmannet/...\')
#11 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Template.php(239): Mage_Core_Block_Template->fetchView(\'frontend/blank/...\')
#12 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Template.php(253): Mage_Core_Block_Template->renderView()
#13 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Abstract.php(753): Mage_Core_Block_Template->_toHtml()
#14 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Abstract.php(520): Mage_Core_Block_Abstract->toHtml()
#15 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Abstract.php(471): Mage_Core_Block_Abstract->_getChildHtml(\'product_list\', true)
#16 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Catalog/Block/Category/View.php(85): Mage_Core_Block_Abstract->getChildHtml(\'product_list\')
#17 /home/bgmannet/public_html/radari.com/app/design/frontend/blank/theme063/template/catalog/category/view.phtml(98): Mage_Catalog_Block_Category_View->getProductListHtml()
#18 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Template.php(212): include(\'/home/bgmannet/...\')
#19 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Template.php(239): Mage_Core_Block_Template->fetchView(\'frontend/blank/...\')
#20 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Template.php(253): Mage_Core_Block_Template->renderView()
#21 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Abstract.php(753): Mage_Core_Block_Template->_toHtml()
#22 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#23 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Abstract.php(753): Mage_Core_Block_Text_List->_toHtml()
#24 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Abstract.php(520): Mage_Core_Block_Abstract->toHtml()
#25 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Abstract.php(471): Mage_Core_Block_Abstract->_getChildHtml(\'content\', true)
#26 /home/bgmannet/public_html/radari.com/app/design/frontend/blank/theme063/template/page/3columns.phtml(51): Mage_Core_Block_Abstract->getChildHtml(\'content\')
#27 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Template.php(212): include(\'/home/bgmannet/...\')
#28 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Template.php(239): Mage_Core_Block_Template->fetchView(\'frontend/blank/...\')
#29 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Template.php(253): Mage_Core_Block_Template->renderView()
#30 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Block/Abstract.php(753): Mage_Core_Block_Template->_toHtml()
#31 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Model/Layout.php(529): Mage_Core_Block_Abstract->toHtml()
#32 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Controller/Varien/Action.php(389): Mage_Core_Model_Layout->getOutput()
#33 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Catalog/controllers/CategoryController.php(115): Mage_Core_Controller_Varien_Action->renderLayout()
#34 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Catalog_CategoryController->viewAction()
#35 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch(\'view\')
#36 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Controller/Varien/Front.php(177): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#37 /home/bgmannet/public_html/radari.com/app/code/core/Mage/Core/Model/App.php(304): Mage_Core_Controller_Varien_Front->dispatch()
#38 /home/bgmannet/public_html/radari.com/app/Mage.php(596): Mage_Core_Model_App->run(Array)
#39 /home/bgmannet/public_html/radari.com/index.php(80): Mage::run(\'\', \'store\')
#40 {main}

Any ideas will be highly appreciated grin

 
Magento Community Magento Community
Magento Community
Magento Community
 
cliffhammock
Jr. Member
 
Total Posts:  15
Joined:  2010-07-31
 

I started getting this similar error after importing products using an extension. There were no errors on the import and the error doesn’t show up everytime I browse a page. But quite often it shows up.

a:5:{i:0;s:78:"Invalid method Mage_Catalog_Block_Product_List_Toolbar::isLastPage(Array
(
)
)";i:1;s:5609:"#0 [internal function]: Varien_Object->__call(’isLastPage’, Array)

 
Magento Community Magento Community
Magento Community
Magento Community
 
dominicgamble
Jr. Member
 
Total Posts:  14
Joined:  2009-04-26
 

For some reason in 1.4 they’ve restructured Mage_Catalog_Block_Product_List_Toolbar. It used to extend Mage_Page_Block_Html_Pager, but they changed it to extend Mage_Core_Block_Template. Mage_Page_Block_Html_Pager has the isLastPage() function.

To fix this you can add the function in yourself:

public function isLastPage()
    
{
        
return $this->getCollection()->getCurPage() >= $this->getLastPageNum();
    
}

They’ve also restructured the way you iterate through pages and get the current page number, so if you have templates that use to call getPages() you’ll need to instead call:

$this->getLastPageNum()
to get the total number of pages and just make a for loop.

Good luck.

 
Magento Community Magento Community
Magento Community
Magento Community
 
freaxxx
Jr. Member
 
Total Posts:  2
Joined:  2010-07-08
 

I love you man wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
frooties
Jr. Member
 
Total Posts:  16
Joined:  2008-11-17
 
dominicgamble - 13 August 2010 11:13 PM

For some reason in 1.4 they’ve restructured Mage_Catalog_Block_Product_List_Toolbar. It used to extend Mage_Page_Block_Html_Pager, but they changed it to extend Mage_Core_Block_Template. Mage_Page_Block_Html_Pager has the isLastPage() function.

To fix this you can add the function in yourself:

public function isLastPage()
    
{
        
return $this->getCollection()->getCurPage() >= $this->getLastPageNum();
    
}

They’ve also restructured the way you iterate through pages and get the current page number, so if you have templates that use to call getPages() you’ll need to instead call:
$this->getLastPageNum()
to get the total number of pages and just make a for loop.

Good luck.

Sounds good but where is the file that needs to be changed (are you talking SQL or HTML?), so us newbies can understand, thanks in advance.

 
Magento Community Magento Community
Magento Community
Magento Community
 
frooties
Jr. Member
 
Total Posts:  16
Joined:  2008-11-17
 

This is what I get

Invalid method Mage_Catalog_Block_Product_List_Toolbar::isLastPage(Array
(
)
)

Trace:
#0 [internal function]: Varien_Object->__call('isLastPage', Array)
#1 /home/bullswe/public_html/store/app/design/frontend/default/default/template/catalog/product/list/toolbar.phtml(58): Mage_Catalog_Block_Product_List_Toolbar->isLastPage()
#2 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Template.php(212): include('/home/bullswe/p...')
#3 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Template.php(239): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#4 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Template.php(253): Mage_Core_Block_Template->renderView()
#5 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Abstract.php(753): Mage_Core_Block_Template->_toHtml()
#6 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Abstract.php(520): Mage_Core_Block_Abstract->toHtml()
#7 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Abstract.php(471): Mage_Core_Block_Abstract->_getChildHtml('toolbar', true)
#8 /home/bullswe/public_html/store/app/code/core/Mage/Catalog/Block/Product/List.php(182): Mage_Core_Block_Abstract->getChildHtml('toolbar')
#9 /home/bullswe/public_html/store/app/design/frontend/default/default/template/catalog/product/list.phtml(41): Mage_Catalog_Block_Product_List->getToolbarHtml()
#10 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Template.php(212): include('/home/bullswe/p...')
#11 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Template.php(239): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#12 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Template.php(253): Mage_Core_Block_Template->renderView()
#13 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Abstract.php(753): Mage_Core_Block_Template->_toHtml()
#14 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Abstract.php(520): Mage_Core_Block_Abstract->toHtml()
#15 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Abstract.php(471): Mage_Core_Block_Abstract->_getChildHtml('product_list', true)
#16 /home/bullswe/public_html/store/app/code/core/Mage/Catalog/Block/Category/View.php(85): Mage_Core_Block_Abstract->getChildHtml('product_list')
#17 /home/bullswe/public_html/store/app/design/frontend/default/default/template/catalog/category/view.phtml(92): Mage_Catalog_Block_Category_View->getProductListHtml()
#18 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Template.php(212): include('/home/bullswe/p...')
#19 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Template.php(239): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#20 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Template.php(253): Mage_Core_Block_Template->renderView()
#21 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Abstract.php(753): Mage_Core_Block_Template->_toHtml()
#22 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#23 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Abstract.php(753): Mage_Core_Block_Text_List->_toHtml()
#24 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Abstract.php(520): Mage_Core_Block_Abstract->toHtml()
#25 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Abstract.php(471): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#26 /home/bullswe/public_html/store/app/design/frontend/default/default/template/page/3columns.phtml(63): Mage_Core_Block_Abstract->getChildHtml('content')
#27 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Template.php(212): include('/home/bullswe/p...')
#28 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Template.php(239): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#29 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Template.php(253): Mage_Core_Block_Template->renderView()
#30 /home/bullswe/public_html/store/app/code/core/Mage/Core/Block/Abstract.php(753): Mage_Core_Block_Template->_toHtml()
#31 /home/bullswe/public_html/store/app/code/core/Mage/Core/Model/Layout.php(529): Mage_Core_Block_Abstract->toHtml()
#32 /home/bullswe/public_html/store/app/code/core/Mage/Core/Controller/Varien/Action.php(389): Mage_Core_Model_Layout->getOutput()
#33 /home/bullswe/public_html/store/app/code/core/Mage/Catalog/controllers/CategoryController.php(115): Mage_Core_Controller_Varien_Action->renderLayout()
#34 /home/bullswe/public_html/store/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Catalog_CategoryController->viewAction()
#35 /home/bullswe/public_html/store/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('view')
#36 /home/bullswe/public_html/store/app/code/core/Mage/Core/Controller/Varien/Front.php(177): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#37 /home/bullswe/public_html/store/app/code/core/Mage/Core/Model/App.php(304): Mage_Core_Controller_Varien_Front->dispatch()
#38 /home/bullswe/public_html/store/app/Mage.php(596): Mage_Core_Model_App->run(Array)
#39 /home/bullswe/public_html/store/index.php(65): Mage::run()
#40 {main}
 
Magento Community Magento Community
Magento Community
Magento Community
 
Hercilio Costa
Member
 
Total Posts:  59
Joined:  2008-07-15
 

It works. Tks dominicgamble.

frooties just copy this:

public function isLastPage()
    
{
        
return $this->getCollection()->getCurPage() >= $this->getLastPageNum();
    
}

and paste in app/code/core/Mage/Core/Block/Template.php after this:

public function getCacheKeyInfo()
    
{
        
return array(
            
'BLOCK_TPL',
            
Mage::app()->getStore()->getCode(),
            
$this->getTemplateFile(),
            
'template' => $this->getTemplate()
        );
    
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
Prashant Dongare
Jr. Member
 
Avatar
Total Posts:  5
Joined:  2008-10-24
 

Good, helpful.

Thanks wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
dankoz
Jr. Member
 
Total Posts:  20
Joined:  2008-05-21
 

Isnt this going to get overwritten in the next upgrade, where can you stick this code so that its not in the core code?

 
Magento Community Magento Community
Magento Community
Magento Community
 
silverpenhouse
Member
 
Avatar
Total Posts:  72
Joined:  2008-02-16
Virginia
 

To avoid having it get overwritten during next update create the following folders:

app/code/local/Mage/Core/Block/

and add your new Template.php in there.

 
Magento Community Magento Community
Magento Community
Magento Community
 
skeable
Jr. Member
 
Total Posts:  3
Joined:  2010-10-27
 

$this->getLastPageNum()

Not quite sure where to put this line of code?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Slait
Jr. Member
 
Total Posts:  1
Joined:  2010-09-28
 

For those who have the same error with the template jm_topaz advise to change the file
app / design / frontend / default / jm_topaz / template / catalog / product / list / toolbar.phtml (file error)
on
app \ design \ frontend \ base \ default \ template \ catalog \ product \ list \ toolbar.phtml (File no errors)

 
Magento Community Magento Community
Magento Community
Magento Community
 
ANDiTKO
Jr. Member
 
Total Posts:  11
Joined:  2009-07-05
 

I made the fixed like you said. Thank you. BUT
Now when i press the next page link i get the first product page again. The next button stopped working. How to make my next button work again. Do you have that error or is just my template?

 
Magento Community Magento Community
Magento Community
Magento Community
 
skeable
Jr. Member
 
Total Posts:  3
Joined:  2010-10-27
 
ANDiTKO - 07 November 2010 03:39 AM

I made the fixed like you said. Thank you. BUT
Now when i press the next page link i get the first product page again. The next button stopped working. How to make my next button work again. Do you have that error or is just my template?

This is the problem I am having too.

 
Magento Community Magento Community
Magento Community
Magento Community
 
skeable
Jr. Member
 
Total Posts:  3
Joined:  2010-10-27
 

Thanks for that, it worked a treat grin

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bogdan
Member
 
Total Posts:  42
Joined:  2007-12-05
 

thanks Hager

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 3