New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix potential TypeError in ProductLazyArray.php #34376
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution @hugofintecture 😉
@hugofintecture Nice catch Hugo! I checked the code and the issue happens because ProductLazyArray can be inflated by two data sources. Normally, PrestaShop/classes/Product.php Line 5740 in df3d44c
But in context of a cart, it's a string of joined attributes - Line 959 in df3d44c
Not sure how to fix it safely... |
Hello @hugofintecture , I can't reproduce your issue without the PR. Screen.Recording.2023-11-03.at.14.25.49.movNormally you should have created an issue before so we can validate it before creating a PR to fix it ^^ |
Hi, @AureRita just reproduced here - #34483, can you do the QA? This definitely is a working fix however. :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA approved, well done! Message to the maintainers: do not forget to milestone it before the merge. |
All good! Merging, thanks everyone |
Fix:
Fatal error: Uncaught TypeError: reset(): ProductLazyArray.php(564)
When switch from French to English gb in the order confirmation page we have this error:
Don't know if it's normal to receive a string however but at least it don't break the page :)
I tried to print all values with this code in the function to find the responsible value:
And here's the problematic string:
string(9) "Taille: S"