When I change the status of brands in the leftpanel extension I get this error and it doesnt change the status Line 180 is this code ->load($leftpanelId)

Fatal error: Call to a member function load() on a non-object in /home/thebeau9/public_html/app/code/local/Nextgeni/Leftpanel/controllers/Adminhtml/BrandsController.php on line 180

public function massStatusAction()
    $leftpanelIds = $this->getRequest()->getParam('leftpanel');
    if(!is_array($leftpanelIds)) {
        Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
    } else {
        try {
            foreach ($leftpanelIds as $leftpanelId) {
                $leftpanel = Mage::getSingleton('leftpanel/leftpanel')
                $this->__('Total of %d record(s) were successfully updated', count($leftpanelIds))
        } catch (Exception $e) {


        <!-- Paypal config model override - Gk on 03-08-2015 -->
                <!-- Model -->
        <!-- Paypal config model override - Gk on 19-08-2015 -->

leftpanel.php in model

 class Nextgeni_Leftpanel_Block_Leftpanel extends Mage_Core_Block_Template


 public function _prepareLayout()
    return parent::_prepareLayout();

 public function getLeftpanel()     
    if (!$this->hasData('leftpanel')) {
        $this->setData('leftpanel', Mage::registry('leftpanel'));
    return $this->getData('leftpanel');



Brand.php in model


class Nextgeni_Leftpanel_Model_Brand extends Mage_Core_Model_Abstract


public function _construct()
  • could you please post the content of your app/code/local/Nextgeni/Leftpanel/etc/config.xml ? Commented Oct 24, 2016 at 10:23
  • 1
    @Raphael config.xml is added. Commented Oct 24, 2016 at 10:30
  • Great and what is the content of app/code/local/Nextgeni/Leftpanel/Model/Leftpanel.php ? Commented Oct 24, 2016 at 10:33
  • Which table you have tried to update?
    – Sohel Rana
    Commented Oct 24, 2016 at 10:34
  • @RaphaelatDigitalPianism added the leftpanel.php file. Commented Oct 24, 2016 at 10:35

1 Answer 1


Whenever you get such error :

Fatal error: Call to a member function load() on a non-object

After calling Mage::getModel('foo/bar') that means that the class corresponding to foo/bar does not exist.

What to check

Checks that foo is declared in your module config.xml in the model node:


Checks that bar is an existing model under your Model folder: app/code/<codePool>/Vendor/Module/Model/Bar.php

In your case

Magento is looking for app/code/local/Nextgeni/Leftpanel/Model/Leftpanel.php but according to your comment, you don't have such file.

I'm not sure what your code is doing and you posted the content of a app/code/local/Nextgeni/Leftpanel/Model/Brand.php so I will assume that's the model that needed to be used in your controller.

Thus you can fix your problem by replacing:

$leftpanel = Mage::getSingleton('leftpanel/leftpanel')


$leftpanel = Mage::getSingleton('leftpanel/brand')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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