3

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.

enter image description here

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!

  • Which version of magento are you using? – lloiacono Feb 7 '17 at 7:55
  • Magento ver. 1.9.2.0 – Faheem Ahmad Feb 7 '17 at 7:56
2

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:

grep -A 5 -r '<Mage_Log>' app/etc/modules

You should see something like this:

<Mage_Log>
        <active>true</active>
        <codePool>core</codePool>

Next check in the admin panel in

System->Configuration->Advanced->Advanced

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:

app/Mage.php in line 254.

It should look like this:

public static function registry($key)
{
    if (isset(self::$_registry[$key])) {
        return self::$_registry[$key];
    }

    Mage::log(self::$_registry[$key], 1, 'issue.log');
    return null;
}

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:

public static function registry($key)
{
    if (isset(self::$_registry[$key])) {
        return self::$_registry[$key];
    }

    die(self::$_registry[$key]);
    return null;
}

Make sure to revert the code changes once you find the issue.

  • Thanks for your answer, How do I know if Mage_log is disabled/enabled? – Faheem Ahmad Feb 7 '17 at 11:52
  • I updated the answer with more details, please check and let me know if this works for you. But I suggest you go to step 3 directly – lloiacono Feb 7 '17 at 13:23
-1

This is the database error, Database is not installing or import propery there is the reason max_execution_time is time out . please go to php.ini file and search max_execution_time and increase this.

More Information please visit here

Problem are resolved

  • Hello @KamleshKumar - Without any doubt this can not be the correct answer. If, for what ever reason, the app/etc/local.xml would be missing, Magento would show you the install setup. Any other issues that might could be in this file (assuming it is present) would lead to completely different errors. – Christoph Farnleitner Feb 3 '18 at 3:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.