Follwoing scenario: - Have a multilingual koha installation, let's say en, de-CH, fr-FR and it-IT - Create external links e.g. from the multilingual library website to each language variant of OPAC: ...cgi-bin/koha/opac-main.pl?language=en ...cgi-bin/koha/opac-main.pl?language=de-CH ...cgi-bin/koha/opac-main.pl?language=fr-FR ...cgi-bin/koha/opac-main.pl?language=it-IT Each link opens fine displaying the language as appropriate. Now try to switch language on the page you just opened via the external link. It won't work, it will always stay on the language defined by the external link.
Created attachment 52628 [details] [review] Bug 16776 - If language is set by external link language switcher does not work To reproduce: - Have a multilingual koha installation, let's say en, de-CH, fr-FR and it-IT - Create external links e.g. from your multilingual library website to each language variant of OPAC: ...cgi-bin/koha/opac-main.pl?language=en ...cgi-bin/koha/opac-main.pl?language=de-CH ...cgi-bin/koha/opac-main.pl?language=fr-FR ...cgi-bin/koha/opac-main.pl?language=it-IT Each link opens fine displaying the language as appropriate. Now try to switch language on the page you just opened via the external link. It won't work, it will always stay on the language defined by the external link. To test: - Apply patch - Repeat steps above - Verify that the language switcher works - Verify in browser address field that after switching language, the param 'language= 'has vanished from url string - Try links with multiple params and with params containing 'language', e.g. ...cgi-bin/koha/opac-search.pl?language=fr-FR&q=language&mylanguage=test - Verify that only the parameter 'language=' vanishes
Still applies.
Sorry, this isn't working for me at all. There is no change in behavior after the patch is applied. Switching language via the URL still works, but using the language-switcher afterwards still fails. The URL is not modified.
Created attachment 53331 [details] [review] Bug 16776 - If language is set by external link language switcher does not work To reproduce: - Have a multilingual koha installation, let's say en, de-CH, fr-FR and it-IT - Create external links e.g. from your multilingual library website to each language variant of OPAC: ...cgi-bin/koha/opac-main.pl?language=en ...cgi-bin/koha/opac-main.pl?language=de-CH ...cgi-bin/koha/opac-main.pl?language=fr-FR ...cgi-bin/koha/opac-main.pl?language=it-IT Each link opens fine displaying the language as appropriate. Now try to switch language on the page you just opened via the external link. It won't work, it will always stay on the language defined by the external link. To test: - Apply patch - Repeat steps above - Verify that the language switcher works - Verify in browser address field that after switching language, the param 'language= 'has vanished from url string - Try links with multiple params and with params containing 'language', e.g. ...cgi-bin/koha/opac-search.pl?language=fr-FR&q=language&mylanguage=test - Verify that only the parameter 'language=' vanishes
Created attachment 53473 [details] [review] [SIGNED-OFF] Bug 16776 - If language is set by external link language switcher does not work To reproduce: - Have a multilingual koha installation, let's say en, de-CH, fr-FR and it-IT - Create external links e.g. from your multilingual library website to each language variant of OPAC: ...cgi-bin/koha/opac-main.pl?language=en ...cgi-bin/koha/opac-main.pl?language=de-CH ...cgi-bin/koha/opac-main.pl?language=fr-FR ...cgi-bin/koha/opac-main.pl?language=it-IT Each link opens fine displaying the language as appropriate. Now try to switch language on the page you just opened via the external link. It won't work, it will always stay on the language defined by the external link. To test: - Apply patch - Repeat steps above - Verify that the language switcher works - Verify in browser address field that after switching language, the param 'language= 'has vanished from url string - Try links with multiple params and with params containing 'language', e.g. ...cgi-bin/koha/opac-search.pl?language=fr-FR&q=language&mylanguage=test - Verify that only the parameter 'language=' vanishes Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 53693 [details] [review] [ALT] Bug 16776: Do not forget external language choice in language switcher If language is set by external link language switcher does not work To reproduce: - Have a multilingual koha installation, let's say en, de-CH, fr-FR and it-IT - Create external links e.g. from your multilingual library website to each language variant of OPAC: ...cgi-bin/koha/opac-main.pl?language=en ...cgi-bin/koha/opac-main.pl?language=de-CH ...cgi-bin/koha/opac-main.pl?language=fr-FR ...cgi-bin/koha/opac-main.pl?language=it-IT Each link opens fine displaying the language as appropriate. Now try to switch language on the page you just opened via the external link. It won't work, it will always stay on the language defined by the external link. To test: - Apply patch - Repeat steps above - Verify that the language switcher works - Verify in browser address field that after switching language, the param 'language= 'has vanished from url string - Try links with multiple params and with params containing 'language', e.g. ...cgi-bin/koha/opac-search.pl?language=fr-FR&q=language&mylanguage=test - Verify that only the parameter 'language=' vanishes
Marc, could you take a look at this counter-patch? Using regex seems easier to resolve this issue.
I tested, the counter patch works as well. That is the most important thing, I will sign-off. Hmm, patch title schuld say: Forget external language choice in language switcher (i.e. language switcher should not take care of language set by external link)
Created attachment 53704 [details] [review] Bug 16776: Do not forget external language choice in language switcher If language is set by external link language switcher does not work To reproduce: - Have a multilingual koha installation, let's say en, de-CH, fr-FR and it-IT - Create external links e.g. from your multilingual library website to each language variant of OPAC: ...cgi-bin/koha/opac-main.pl?language=en ...cgi-bin/koha/opac-main.pl?language=de-CH ...cgi-bin/koha/opac-main.pl?language=fr-FR ...cgi-bin/koha/opac-main.pl?language=it-IT Each link opens fine displaying the language as appropriate. Now try to switch language on the page you just opened via the external link. It won't work, it will always stay on the language defined by the external link. To test: - Apply patch - Repeat steps above - Verify that the language switcher works - Verify in browser address field that after switching language, the param 'language= 'has vanished from url string - Try links with multiple params and with params containing 'language', e.g. ...cgi-bin/koha/opac-search.pl?language=fr-FR&q=language&mylanguage=test - Verify that only the parameter 'language=' vanishes Tested counter patch, works as well. Signed-off-by: Marc <veron@veron.ch>
Comment on attachment 53473 [details] [review] [SIGNED-OFF] Bug 16776 - If language is set by external link language switcher does not work Obsoelted in favour of Jonathan's counter patch.
(In reply to Marc Véron from comment #9) > I tested, the counter patch works as well. That is the most important thing, > I will sign-off. > Hmm, patch title schuld say: Forget external language choice in language > switcher (i.e. language switcher should not take care of language set by > external link) Well, it depends on how you see things actually :) I wanted to say: Do not forget what has been passed in url when you click on the language switcher.
Setting to signed-off (for counter patch, tested 2016-07-26 - comment #10)
Created attachment 54117 [details] [review] [PASSED QA] Bug 16776: Do not forget external language choice in language switcher If language is set by external link language switcher does not work To reproduce: - Have a multilingual koha installation, let's say en, de-CH, fr-FR and it-IT - Create external links e.g. from your multilingual library website to each language variant of OPAC: ...cgi-bin/koha/opac-main.pl?language=en ...cgi-bin/koha/opac-main.pl?language=de-CH ...cgi-bin/koha/opac-main.pl?language=fr-FR ...cgi-bin/koha/opac-main.pl?language=it-IT Each link opens fine displaying the language as appropriate. Now try to switch language on the page you just opened via the external link. It won't work, it will always stay on the language defined by the external link. To test: - Apply patch - Repeat steps above - Verify that the language switcher works - Verify in browser address field that after switching language, the param 'language= 'has vanished from url string - Try links with multiple params and with params containing 'language', e.g. ...cgi-bin/koha/opac-search.pl?language=fr-FR&q=language&mylanguage=test - Verify that only the parameter 'language=' vanishes Tested counter patch, works as well. Signed-off-by: Marc <veron@veron.ch> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master for 16.11, thanks Jonathan!
Pushed in 16.05. Will be in 16.05.03.
Pushed to 3.22.x, will be in 3.22.10