- 🇮🇳India prashant.c Dharamshala
"\Drupal::request()->query->remove('destination');" needs to be converted to use dependency injection, you need to inject the "request_stack" service as a dependency using
Symfony\Component\HttpFoundation\RequestStack
.
- Status changed to Needs review
almost 2 years ago 3:19pm 16 March 2023 - 🇮🇳India sahil.goyal
Addressing #3, as suggestive using the DI for removing the query param.
Getting a WSOD with the latest patch.
Attaching the correct fix for the dev version.
- Status changed to Needs work
almost 2 years ago 4:50am 21 March 2023 - 🇮🇳India prashant.c Dharamshala
use
statement not used to include the required classes in the patch submitted in #4 @prashant.c , what do u mean by use statement for the classes not included in the patch? The required service is already being injected in code written previously.
There is another issue in the patch submitted in 4 (and now 5 also). The url being switched to, still has the destination parameter in it. which means that when i save an entity in the switched language, it goes back to the old language.
The right solution would be to change the destination to the language being switched, but i will leave that to the language experts . Submitting a temporary patch to remove the destination in the new url also , for now.
- First commit to issue fork.
- @shivam_tiwari opened merge request.
- Status changed to Needs review
almost 2 years ago 1:12pm 21 March 2023 Hello,
I have reviewed the patch in #8, and I noticed it removes the destination query parameter. I believe this is not the intended behavior, as the destination parameter is essential for the entity edit form and other pages. The language switcher provided by Core operates similarly. it retains the destination parameter.
Patch #5 works well, but there is an additional concern. When the language is changed, the destination parameter retains the old language prefix. So, if a user changes the language on the entity edit form and submits it, the system will redirect to the old language based on the destination parameter. This issue also exists in the Core language switcher.