Bug 18946 - Change language from external web fails
Summary: Change language from external web fails
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Karam Qubsi
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-17 13:30 UTC by Hugo Agud
Modified: 2019-10-14 19:57 UTC (History)
7 users (show)

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


Attachments
Bug-18946- Change-language-from-external-web-fails (1.46 KB, patch)
2017-07-18 16:17 UTC, Karam Qubsi
Details | Diff | Splinter Review
Bug 18946 - Change language from external web fails (1.50 KB, patch)
2017-09-01 12:42 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 18946 [QA Followup] - code cleanup (1.68 KB, patch)
2017-09-01 12:42 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 18946 - Change language from external web fails (1.54 KB, patch)
2017-09-01 13:08 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 18946 [QA Followup] - code cleanup (1.68 KB, patch)
2017-09-01 13:08 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Hugo Agud 2017-07-17 13:30:21 UTC
We have identified that if you add the url to change language from one external web to koha, it doesn't work it just send you again to your current web.

How to reproduce:
1. Get a multilingüal Koha like 
http://demo1.orex.es/cgi-bin/koha/opac-changelanguage.pl?language=en
http://demo1.orex.es/cgi-bin/koha/opac-changelanguage.pl?language=es-ES

2. Copy that urls to any web page and try to link to the spanish or english version,it will keep you in the same position

we suspect is opac-changelanguage.pl becuase it gets the url from the referer and then construct a wrong url becuase of the referer... If 

#my $url      = $query->referer() || '/';
my $url    = 'https://whatever/';

it works.. because we force the referer to the koha host domain
Comment 1 Karam Qubsi 2017-07-18 09:46:09 UTC Comment hidden (obsolete)
Comment 2 Karam Qubsi 2017-07-18 16:17:12 UTC
Created attachment 65089 [details] [review]
Bug-18946- Change-language-from-external-web-fails

How to reproduce:
1. Get a multilingüal Koha like
http://demo1.orex.es/cgi-bin/koha/opac-changelanguage.pl?language=en
http://demo1.orex.es/cgi-bin/koha/opac-changelanguage.pl?language=es-ES

2. Copy that urls to any web page in an other domain -it must be in some
host - and try to link to the spanish or english version,it will keep you in the same position.

3. Apply this patch and try again , everything should work fine .
Comment 3 Hugo Agud 2017-08-23 08:13:11 UTC
Sorry for the delay, the patch it works fine!

thanks!
Comment 4 Kyle M Hall 2017-09-01 12:42:16 UTC
Created attachment 66719 [details] [review]
Bug 18946 - Change language from external web fails

How to reproduce:
1. Get a multilingüal Koha like
http://demo1.orex.es/cgi-bin/koha/opac-changelanguage.pl?language=en
http://demo1.orex.es/cgi-bin/koha/opac-changelanguage.pl?language=es-ES

2. Copy that urls to any web page in an other domain -it must be in some
host - and try to link to the spanish or english version,it will keep you in the same position.

3. Apply this patch and try again , everything should work fine .

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Kyle M Hall 2017-09-01 12:42:22 UTC
Created attachment 66720 [details] [review]
Bug 18946 [QA Followup] - code cleanup

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Kyle M Hall 2017-09-01 13:08:21 UTC
Created attachment 66733 [details] [review]
Bug 18946 - Change language from external web fails

How to reproduce:
1. Get a multilingüal Koha like
http://demo1.orex.es/cgi-bin/koha/opac-changelanguage.pl?language=en
http://demo1.orex.es/cgi-bin/koha/opac-changelanguage.pl?language=es-ES

2. Copy that urls to any web page in an other domain -it must be in some
host - and try to link to the spanish or english version,it will keep you in the same position.

3. Apply this patch and try again , everything should work fine .

Signed-off-by: Hugo Agud <hagud@orex.es>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 7 Kyle M Hall 2017-09-01 13:08:54 UTC
Created attachment 66734 [details] [review]
Bug 18946 [QA Followup] - code cleanup

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 8 Jonathan Druart 2017-09-01 16:06:42 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 9 Fridolin Somers 2017-10-03 09:36:48 UTC
Pushed to 17.05.x, will be in 17.05.05.
Comment 10 Katrin Fischer 2017-10-06 06:11:48 UTC
These patches have been pushed to 16.11.x and will be in 16.11.13.
Comment 11 Mason James 2017-11-23 23:09:24 UTC
Pushed to 16.05.x, for 16.05.18 release
Comment 12 Marcel de Rooy 2018-07-30 11:38:17 UTC
This patch causes the bug reported on bug 19799.
Especially if you use https and Plack..