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
Hi , Instead of using /cgi-bin/koha/opac-changelanguage.pl?language=en You may try :/cgi-bin/koha/opac-main.pl?language=en it look like opac-changelanguage.pl always assuming that you are on the same domain , there should be further tests to handle that perhaps something like this : my $domain = C4::Context->preference("OPACBaseURL"); my $url = $query->referer() || '/'; if ($query->referer() !~ /$domain/ ) { $url = $domain ; }
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 .
Sorry for the delay, the patch it works fine! thanks!
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>
Created attachment 66720 [details] [review] Bug 18946 [QA Followup] - code cleanup Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
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>
Created attachment 66734 [details] [review] Bug 18946 [QA Followup] - code cleanup Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to master for 17.11, thanks to everybody involved!
Pushed to 17.05.x, will be in 17.05.05.
These patches have been pushed to 16.11.x and will be in 16.11.13.
Pushed to 16.05.x, for 16.05.18 release
This patch causes the bug reported on bug 19799. Especially if you use https and Plack..