Mage_Adminhtml_Block_Widget | Fatal error: Call to a member function setData() on a non-object in /includes/src/Mage_Adminhtml_Block_Widget_Grid.php on line 299

Monday, 22. August 2011

Magento Compilation is great but can easily piss you off especially when you encounter an error such as this.

I have been approached for too many times in regards to this error, I think it will benefit many if share it on my blog!

The simple and quick way to solve this is by:

1) Access you site root folder via FTP or Control Panel or Any way you can get to the index.php file!

2) Open the index.php folder and look for the following block of code

$compilerConfig = 'includes/config.php';
if (file_exists($compilerConfig)) {
    include $compilerConfig;
}

3) Comment it out completely.

4) Log back in to your admin and finish the compilation process. Make sure its back to being disabled after the process finishes.

5) Uncomment the block of code in the index.php file you commented out in step 2.

NOTE
You can also disable compilation from command line with the following line

php magentodir/shell/compiler.php disable

All done!!

4 Responses to “Mage_Adminhtml_Block_Widget | Fatal error: Call to a member function setData() on a non-object in /includes/src/Mage_Adminhtml_Block_Widget_Grid.php on line 299”



  1. JOPIEMULDER Says:

    Thanks for the solutiuon, works fine!



  2. zonemaster Says:

    glad it helped you! :)



  3. naresh.sangana Says:

    it’ not works for me this is my error
    Fatal error: Call to a member function setData() on a non-object in D:\xampp\htdocs\magento\app\code\core\Mage\Eav\Model\Config.php on line 651



  4. zonemaster Says:

    I am not sure we are talking the same error here Naresh. This solution works only for settings that have compilation enabled.

    Looking at your error, you are facing something different unrelated to this post.

    You may want to check that your PHP version on this machine is supported by Magento. Also, it looks like you are on local machine – make sure your URL is not localhost/magento – instead make up a hosts file for desktop.com or something that Magento can work with.

Leave a Reply

You must be logged in to post a comment.