Magento ver. 1.9.2.0
I have recently setup a clone staging environment of my live site for testing purposes. The backend and front-end home & other pages are loading fine. Except when I browse product pages, I see the following error
Fatal error: Call to a member function getIdFieldName() on a
non-object in html/app/code/core/Mage/Core/Model/Abstract.php on line
151
See image below for reference.
Things that I have tried:
I have re-copied the html/app/etc/config.xml
file from live to staging via FTP. Didn't work
Please help.
Thanks!
Best Answer
This issue could be due to different reasons.
1 - Firstly start by cleaning your cache and check.
2 - Then make sure you have not disabled Mage_log as described here
To do that you execute this in your magento docroot:
You should see something like this:
Next check in the admin panel in
see if the module output is enabled there as well.
3 - Finally this issue happens when there is no resource defined for a given Model. To find out which is the Model that is failing you can add a log to this file:
It should look like this:
Then you can check your log file in here:
var/log/issue.log
Or if you want to do it quick and dirty do it like this:
Make sure to revert the code changes once you find the issue.