Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The module works perfectly fine, except one case:
User been redirected from some page and has query parameters passed to the url. Now suppose, if user changes the language then the query parameters in URL get disappear.
Attached is the patch, which will append query parameters in URL.
This patch is tested against 7.x-1.2
Regards,
Yogesh
Comments
Comment #1
rahuldolas123 CreditAttribution: rahuldolas123 commentedThe attached file is a patch, which will append query parameters in URL. The patch is developed and tested for version 7.x-1.5.
In version 7.x-1.5, $lang_options['query'] was not defined to update query in url. This patch fixes that issue and the url queries don't disappear anymore even after change of language.
Comment #2
rahuldolas123 CreditAttribution: rahuldolas123 commentedThe attached file is a patch, which will append query parameters in URL. The patch is developed and tested for version 7.x-1.5.
In version 7.x-1.5, $lang_options['query'] was not defined to update query in url. This patch fixes that issue and the url queries don't disappear anymore even after change of language.
Comment #3
yogeshchaugule8 CreditAttribution: yogeshchaugule8 commentedThanks for pointing out that rahul, the module was already trying to maintain the query parameters in URL while changing language, but it was not setting up the value of query parameter, before assigning it to URL.
Yogesh
Comment #4
Sarnas CreditAttribution: Sarnas commentedI had the same issue that then user changes the language the query parameters in url get disappear. I patched lang_dropdown.module with Your last patch and yes it helped - query parameters are not disappearing, but new issue popped out:
user had this url:
custom_module/q?name=Name&source[first]=1&source[second]=1
then user changes language and url gets like this:
custom_module/q?name=Name&source[first]=1&source[second]=1
then user changes language one more time and url gets like this:
custom_module/q?name=Name&amp%3Bsource[first]=1&amp%3Bsource[second]=1
if user continues changing languages -
&
keeps appearing continuously.Could You help to fix this issue?
Comment #5
manfer CreditAttribution: manfer commentedVersion 7.x-2.1 solves this problem