When an admin performs actions on the Orders view, the operation urls don't use the admin language.
"View", "Edit", "Reassign" and "Delete" return non-multilingual urls.
Only the "Payments" operation will redirect the admin to an url in his current language.
Proposal
Add LanguageManagerInterface to OrderListBuilder.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3248322-2.patch | 3.91 KB | simgui8 |
Comments
Comment #2
simgui8 commentedHere is a patch.
Comment #3
simgui8 commentedComment #4
jsacksick commentedThe documentation says the following:
Besides, we don't specify it for payments, so why would we need to specify the language here?
Comment #5
simgui8 commentedThanks jsacksick for the follow-up.
On a fresh Drupal 9.2.8
with latest Commerce 2.x-dev.
Here is the multilingual url structure, which is pretty common:
d9.ddev.site/fr/admin/commerce
When navigating to order:
d9.ddev.site/fr/admin/commerce/orders
Here is the operations urls links for an order:
d9.ddev.site/admin/commerce/orders/1
d9.ddev.site/admin/commerce/orders/1/edit
d9.ddev.site/admin/commerce/orders/1/reassign
d9.ddev.site/fr/admin/commerce/orders/1/payments
d9.ddev.site/admin/commerce/orders/1/delete
Only payments have the language structure.
Now, let's say I am a french admin. Most actions I do will bring me to a page in my language.
But not order operations.
This seems awkward to me.
Comment #6
jsacksick commentedI'm not saying we shouldn't fix this, or there's no bug. I'm just saying that we don't specify the language for the "payments" entity operation but yet the link correctly contains the "language" code. That's all.
Comment #7
simgui8 commentedOk!
I'll be glad to help if there is a better approach than #2 or if I should improve it.
Comment #8
jgullstr commentedFixing #3061761: The language of content entities incorrectly falls back to the default language of the content whilst ignoring the current language of the user should resolve this problem without having to patch this module.