Jump to content

How to solve "ContextErrorException in ProductAssembler.php line 88" PrestaShop (1.7.0.5)


HugeB

Recommended Posts

Hi,

 

if i change main language i recivie error:

ContextErrorException in ProductAssembler.php line 88:
Notice: Undefined offset: 0
 
Full error can be seen here on site:
 
On default language it's OK.
 
How can i solve that? I don't know where to start resolving, because error page don't tell me anything, or?
 
Thank you!
Regards.
Link to comment
Share on other sites

UPDATE: I disabled DEBUG mode in backoffice, and now languages loads without error. It's that normal for PrestaShop?

 

debug mode should  only be enabled when actively debugging but if left on can result in unpredictable results.  this is not an uncommon issue across more complex (cart based) cms's. really anything that uses .js can fall over pretty easy...lol

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...
  • 3 months later...
  • 3 months later...

Hello!

In my case, the problem is not in code, it is in database.

Error apears when the user has in his favourite list a deleted product. Then, PrestaShop tries to load this product, but it cannot find it.

Solution is search all references of deleted product IDs in table st_loved_product, in the id_source field. You must delete these rows, and error should disappear.

Good luck!

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
  • 1 year later...
  • 1 month later...
  • 4 months later...

This can happen also with modules saving the product IDs to use in some arrays, and then using ProductAssembler. It happened with ETS Mega Menu, adding products in the product list widget. After deleting a product the module still asks for that ID and Prestashop gives this error. The solution is to update the module configuration, deleting the missing product.

Link to comment
Share on other sites

  • 1 year later...
On 6/18/2020 at 3:50 PM, zod said:

This can happen also with modules saving the product IDs to use in some arrays, and then using ProductAssembler. It happened with ETS Mega Menu, adding products in the product list widget. After deleting a product the module still asks for that ID and Prestashop gives this error. The solution is to update the module configuration, deleting the missing product.

thank you very much the problem was resolved directly after i reset the ETS Mega Menu 😊

Link to comment
Share on other sites

  • 1 year later...
On 3/6/2017 at 5:55 PM, HugeB said:

UPDATE: I disabled DEBUG mode in backoffice, and now languages loads without error. It's that normal for PrestaShop?

Yes i think it's normal since the debug mode is not made for normal use, except you need to read error details or get other dev stuff

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...