Jump to content

Trying to get property 'id' of non-object in /classes/module/Module.php on line 2137


musicmaster

Recommended Posts

In my Cpanel server log I see the following error appearing many times:

Trying to get property 'id' of non-object in /classes/module/Module.php on line 2137

When I look at that line in the code (Prestashop 8.2.3) I see:

if (Db::getInstance()->getValue('SELECT `id_module` FROM `' . _DB_PREFIX_ . 'module_shop` WHERE `id_module` = ' . (int) $id_module . ' AND `id_shop` = ' . (int) Context::getContext()->shop->id)) {
                $active = true;

There is only one "id" here: Context::getContext()->shop->id

I don't see the error in the localhost copy of the shop. 

Does anyone have an id what could be happening here?

 

Link to comment
Share on other sites

Hi,

if you can access to the stack trace part ( in error log should be present) you can understand what is calling module.php in that line. This code has to do with module loading process. Maybe there is a cron running without shop context or also a CLI script...this is why it doesn't happen in your localhost. Just guessing here. Check the stack trace and you will have more detailed info!!

 

ciao

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...