Default language and assigned shop languages inconsistencies #32986
Labels
1.7.8.9
Affects versions
Bug
Type: Bug
Email
Label: Which BO under menu is concerned
Languages
Label: Which BO under menu is concerned
Minor
Severity: minor bug > https://build.prestashop.com/news/severity-classification
Order
Component: Which BO section is concerned
Ready
Status: Issue is ready to be worked on
Shopping carts FO
All the issues related to the Front Office Shopping Cart
Verified
The issue has been reproduced
Prerequisites
Describe the bug and add attachments
When the default shop language is not within the assigned languages (Which is a configuration error), the shop looks working normal. However, when an order is made, the confirmation mail of the payment is sent in the default language and not in the user language, and the redirect to the payment confirmation page resulted in a wrong URL and yields a 404.
Expected behavior
It is a misconfiguration, so, according to GIGO everything is allowed to happen. OTOH, the behaviour reveals some inconsistencies which might cause problems in other scenarios as well.
Possible improvements:
Findings in the code:
The
FrontController
creates the cart with the language from the cookie.But usually
Context::getContext()->language->id
is used. The problem is that the both might differ, because id_lang in the cookie is not sanitised and may be a not supported language.The
PaymentModuleCore->validateOrder
changes the context language to the cart language.This is correct behaviour, because we want to send the mail in the language present while ordering. However, the context language needs to be restored to the initial request language after that.
This is all low prio. However, I thought it's worth writing down. Let me know whether this is helpful or not.
Steps to reproduce
I am using multi site, however, it should be the same with a single shop.
/order-confirmation
instead of/bestellbestatigung
and yields 404PrestaShop version(s) where the bug happened
8.0.4
PHP version(s) where the bug happened
8.1
If your bug is related to a module, specify its name and its version
No response
Your company or customer's name goes here (if applicable).
headissue GmbH
The text was updated successfully, but these errors were encountered: