Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8819601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:24:05+00:00 2026-06-14T05:24:05+00:00

After the upgrade I was getting the error: Fatal error: Call to a member

  • 0

After the upgrade I was getting the error:

Fatal error: Call to a member function getSize() on a non-object in ./app/design/frontend/base/default/template/catalog/product/list/toolbar.phtml on line 34

Offending line: <?php if($this->getCollection()->getSize()): ?>

After some quick debugging I found getCollection was returning null. As a workaround I manually set the collection:

$collection = Mage::getModel('catalog/product')->getCollection()
            ->addAttributeToSelect('*');
$this->setCollection($collection);

My question, why isn’t the collection being set? Where would it normally be set?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:24:06+00:00Added an answer on June 14, 2026 at 5:24 am

    The is normally set in the parent catalog/product_list block’s _beforeToHtml method.

    #File: app/code/core/Mage/Catalog/Block/Product/List.php
    protected function _beforeToHtml()
    {
        $toolbar = $this->getToolbarBlock();
    
        // called prepare sortable parameters
        $collection = $this->_getProductCollection();
    
        // use sortable parameters
        if ($orders = $this->getAvailableOrders()) {
            $toolbar->setAvailableOrders($orders);
        }
        if ($sort = $this->getSortBy()) {
            $toolbar->setDefaultOrder($sort);
        }
        if ($dir = $this->getDefaultDirection()) {
            $toolbar->setDefaultDirection($dir);
        }
        if ($modes = $this->getModes()) {
            $toolbar->setModes($modes);
        }
    
        // set collection to toolbar and apply sort
        $toolbar->setCollection($collection);
    
        $this->setChild('toolbar', $toolbar);
        Mage::dispatchEvent('catalog_block_product_list_collection', array(
            'collection' => $this->_getProductCollection()
        ));
    
        $this->_getProductCollection()->load();
    
        return parent::_beforeToHtml();
    }
    

    Specifically this line.

    $toolbar->setCollection($collection);
    

    My guess would be your system was heavily modified such that the toolbar block no longer had catalog/product_list as a parent.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After upgrade to Rails 3.0.10 I'm getting strange error if I set config.cache_classes=true NoMethodError
After I upgrade to Node 0.6.18, I got the error: listen EINVAL when start.
Following fatal error we are getting in apache errorlog. So IO operation increased and
after upgrade, all the pages see Models as Object. I've upgraded using migration guide
I am getting the following errors after an upgrade. I cannot figure what is
Just upgraded to Xcode 4.5. Figured out after getting bugs in my app in
A .NET 4.0 application needs to run without errors after system upgrade from Windows
Is there a way i can uninstall (and dont upgrade after) a previous version
After a system upgrade i am no longer able to start my tomcat5 server.
This is a warning that began to appear after I upgraded my app from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.