I am getting the error in my custom admin module -

 Fatal error: Call to a member function setSaveParametersInSession() on a non-object in /var/www/html/B2BMarkets/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Container.php on line 66

Siteadmin_Approval is my module name. Here is controller -

class Siteadmin_Approval_Adminhtml_ApprovalController extends Mage_Adminhtml_Controller_action

    protected function _initAction() {

        return $this;

    public function indexAction() { 


        public function viewAction() {


and Block -


class Siteadmin_Approval_Block_Adminhtml_Approval_View extends
                    Mage_Adminhtml_Block_Widget_Grid_Container {
  public function __construct()
        $this->_controller = 'adminhtml_approval_view';
        $this->_blockGroup = 'approval';
        $this->_headerText = Mage::helper('approval')->__('Company Users');

        $data = array(
        'label' =>  'Back',
        'onclick'   => 'setLocation(\'' . $this->getUrl('*/*') . '\')',
        'class'     =>  'back'
        $this->addButton ('my_back', $data, 0, 100,  'header'); 



and app/code/local/Siteadmin/Approval/Block/Adminhtml/Approval/View/View.php

class Siteadmin_Approval_Block_Adminhtml_Approval_View extends
                    Mage_Adminhtml_Block_Widget_Grid {
  public function __construct()


  protected function _prepareCollection()
     $comp_id = Mage::getSingleton('admin/session')->getCompanyId();

     $catalog_id = $this->getRequest()->getParam("id");

     try {
      $collection = Mage::getModel('newuser/companyuser')->getCollection()
                     ->addFieldToFilter("company_details_id", array("eq"=>$this->getRequest()->getParam("id")));


     } catch(Exception $e)
                           array('id' => $this->getRequest()

      return parent::_prepareCollection();

  protected function _prepareColumns()
      $this->addColumn('first_name', array(
          'header'    => Mage::helper('approval')->__('First Name'),
          'align'     =>'right',
          'width'     => '50px',
          'index'     => 'first_name',
           'align'     => 'left',

     $this->addColumn('is_active', array(
          'header'    => Mage::helper('approval')->__('Is Active'),
          'align'     =>'center',
          'index'     => 'is_active',
          'type'      => 'text',
          'width'     => '150px',
          'align'     => 'left',
          'filter'    => FALSE


      return parent::_prepareColumns();

  public function getGridUrl()    {
      return $this->getUrl('*/*/view/', array('_current'=>true));    


can anybody please help me to figure out what I am doing wrong here?


1 Answer 1


You have your Grid class defined as app/code/local/Siteadmin/Approval/Block/Adminhtml/Approval/View/View.php. If you take a look at the line where this error is coming from (line no. 66 in app/code/core/Mage/Adminhtml/Block/Widget/Grid/Container.php), you can see that grid is kind of hard-coded in there as to be the last word of your grid class. Try with having your grid class renamed as app/code/local/Siteadmin/Approval/Block/Adminhtml/Approval/View/Grid.php.

Edit :

Just found this detailed explanation about the same issue : Fatal error: Call to a member function setSaveParametersInSession() on a non-object in aBlock\Widget\Grid\Container.php on line 66

This question might fall into Duplicate one !

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.