Bug 16776 - If language is set by external link language switcher does not work
Summary: If language is set by external link language switcher does not work
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-20 08:52 UTC by Marc Véron
Modified: 2017-12-07 22:15 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 16776 - If language is set by external link language switcher does not work (2.23 KB, patch)
2016-06-20 20:56 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 16776 - If language is set by external link language switcher does not work (2.28 KB, patch)
2016-07-12 18:15 UTC, Marc Véron
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 16776 - If language is set by external link language switcher does not work (2.39 KB, patch)
2016-07-18 13:10 UTC, Owen Leonard
Details | Diff | Splinter Review
[ALT] Bug 16776: Do not forget external language choice in language switcher (2.50 KB, patch)
2016-07-25 15:39 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16776: Do not forget external language choice in language switcher (2.57 KB, patch)
2016-07-25 16:59 UTC, Marc Véron
Details | Diff | Splinter Review
[PASSED QA] Bug 16776: Do not forget external language choice in language switcher (2.64 KB, patch)
2016-08-07 11:35 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2016-06-20 08:52:42 UTC
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.
Comment 1 Marc Véron 2016-06-20 20:56:47 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2016-07-10 18:48:47 UTC
Still applies.
Comment 3 Owen Leonard 2016-07-11 15:40:06 UTC
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.
Comment 4 Marc Véron 2016-07-12 18:15:38 UTC Comment hidden (obsolete)
Comment 5 Owen Leonard 2016-07-18 13:10:59 UTC Comment hidden (obsolete)
Comment 6 Marc Véron 2016-07-21 05:39:18 UTC
Still applies.
Comment 7 Jonathan Druart 2016-07-25 15:39:03 UTC Comment hidden (obsolete)
Comment 8 Jonathan Druart 2016-07-25 15:39:39 UTC
Marc, could you take a look at this counter-patch?
Using regex seems easier to resolve this issue.
Comment 9 Marc Véron 2016-07-25 16:58:12 UTC
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)
Comment 10 Marc Véron 2016-07-25 16:59:18 UTC Comment hidden (obsolete)
Comment 11 Marc Véron 2016-07-25 17:00:25 UTC
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.
Comment 12 Jonathan Druart 2016-07-25 17:27:56 UTC
(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.
Comment 13 Marc Véron 2016-07-26 11:51:15 UTC
Setting to signed-off (for counter patch, tested 2016-07-26 - comment #10)
Comment 14 Katrin Fischer 2016-08-07 11:35:12 UTC
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>
Comment 15 Kyle M Hall 2016-08-10 13:51:47 UTC
Pushed to master for 16.11, thanks Jonathan!
Comment 16 Frédéric Demians 2016-08-23 09:44:52 UTC
Pushed in 16.05. Will be in 16.05.03.
Comment 17 Julian Maurice 2016-08-23 15:42:02 UTC
Pushed to 3.22.x, will be in 3.22.10