Jump to content

Prestashop 1.7.6.8 - constant errors for classes/Tools.php


Recommended Posts

Hello.

I've my error log flooded with messages like :

PHP message: PHP Notice:  Trying to get property 'id' of non-object in <presta home>l/classes/Tools.php on line 1346

 

the function is this:

Quote

    public static function getAdminTokenLite($tab, Context $context = null)
    {
        if (!$context) {
            $context = Context::getContext();
        }

        return Tools::getAdminToken($tab . (int) Tab::getIdFromClassName($tab) . (int) $context->employee->id);       <------------------------- Line 1346 !!
    }

 

Can you please help?

I'm having issues about very slow back office, and I'm not sure if this is related or not.

 

Thank you.

Share this post


Link to post
Share on other sites

Hi,

You  are  trying  :     $context->employee->id      and  $context   seems  not   to  be  declared.

Try  :  $this->context->employee->id   

 

Share this post


Link to post
Share on other sites

Hi!

 

Just tried it, but no change.

 

But the var seems to be declared here:

Quote

        if (!$context) {
            $context = Context::getContext();
        }

right ?

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More