Magento Forum

   
setSaveParametersInSession() on a non-object on cache page
 
frenske
Jr. Member
 
Total Posts:  7
Joined:  2008-08-13
 

An error ocurrs on the system->cache management page.

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

He tries to make a block with this function call:
$this->getLayout()->createBlock("adminhtml/cache_gridcache.grid")

The result of this function call is false, so he can not create the block for some reason. Am I missing some files, or is this a bug in magento?

I´ve created an issue, http://www.magentocommerce.com/bug-tracking/issue?issue=8967. Nobody has replied yet.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Salepoint Israel
Jr. Member
 
Total Posts:  17
Joined:  2009-10-19
Israel
 

Hi,
I just had a couple of days debugging this error. In my case it was the _blockGroup and _controller fields that were not defined properly..
This is how Magento uses them:

$this->setChild( ‘grid’,
$this->getLayout()->createBlock( $this->_blockGroup.’/’ . $this->_controller . ‘_grid’,
$this->_controller . ‘.grid’)->setSaveParametersInSession(true) );

Therefore:
- _blockGroup - is your module name
- _controller - is actually the path to your block class (NOT YOUR CONTROLLER). This is somehow mixed with controller… so in my case it was adminhtml_<block>. Notice that <block> is a class that extends Mage_Adminhtml_Block_Widget_Grid_Container (in case you’re using a grid).

Hope this helps…
Cheers,
Avi Shefi.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jpiche
Jr. Member
 
Total Posts:  2
Joined:  2010-07-06
 

Just wanted to say thanks for this information, it really saved me a ton of time. I couldn’t find this information in any documentation.

 
Magento Community Magento Community
Magento Community
Magento Community
 
chapagain
Sr. Member
 
Avatar
Total Posts:  202
Joined:  2009-07-19
 

Therefore:
- _blockGroup - is your module name
- _controller - is actually the path to your block class (NOT YOUR CONTROLLER).

Thanks Salepoint Israel for this helpful information.

 
Magento Community Magento Community
Magento Community
Magento Community
 
eMageln
Jr. Member
 
Total Posts:  22
Joined:  2010-02-04
France, Annecy
 

thanks, very helpful !

 
Magento Community Magento Community
Magento Community
Magento Community
 
albertjooger
Jr. Member
 
Total Posts:  10
Joined:  2011-04-08
 

Thanks to share this topic with us. Its really very nice and also important for the related persons like me, who has the complete information about that process and the newcomer who read these posts and also the topic let it them not so serious.. But again thanks for this nice sharing.

 
Magento Community Magento Community
Magento Community
Magento Community
 
markoshust
Sr. Member
 
Avatar
Total Posts:  129
Joined:  2007-09-05
Cleveland, OH
 

Thanks for the post, very easy to overlook this during development.

I know this is an old post, but just a quick reference for easy lookup, $this->_controller should match the second half of your block definition

<block type="yournamespace_yourmodule/adminhtml_list” name="yourmodule.grid.container"></block>

 
Magento Community Magento Community
Magento Community
Magento Community
 
Magebooker
Jr. Member
 
Avatar
Total Posts:  8
Joined:  2011-09-17
United States
 

Good job, save me mass time.
Thank you so much.

 
Magento Community Magento Community
Magento Community
Magento Community
 
AlexTalda
Jr. Member
 
Avatar
Total Posts:  6
Joined:  2013-07-15
 

very helpful, thanks you a lot!

 
Magento Community Magento Community
Magento Community
Magento Community
 
muk_t
Sr. Member
 
Total Posts:  222
Joined:  2012-07-24
 

@Salepoint Israel

Your solution helped me.
Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top