Home » Magento28 March 2011

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


I was creating a module. I already had one Grid displayed in admin. The Grid was being displayed by a Block class, for example: MyNamespace_MyModule_Block_Adminhtml_MyModule
Now, I had to display another Grid using a new Block class. Let’s say, I created a new Block class: MyNamespace_MyModule_Block_Adminhtml_MyNewGrid

I just copied code from MyNamespace_MyModule_Block_Adminhtml_MyModule and copied it to MyNamespace_MyModule_Block_Adminhtml_MyNewGrid class.




The main mistake over here was the confusing naming for controller and blockGroup.

$this->_controller = This is not the controller class name. It is actually your Block class name.
$this->_blockGroup = This is your module’s name.


Hence, I updated my new grid class in the following way and the problem was solved. See the change in controller and blockGroup from the previous code.


Hope this helps. Thanks.


Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed