[Bug 43444] New: After logout and immediate login, language selection link takes back to login page
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 Bug ID: 43444 Summary: After logout and immediate login, language selection link takes back to login page Initiative type: --- Sponsorship --- status: Product: Koha Version: 26.05 Hardware: Macintosh OS: Mac OS Status: NEW Severity: minor Priority: P5 - low Component: Authentication Assignee: koha-bugs@lists.koha-community.org Reporter: esa-pekka.keskitalo@helsinki.fi QA Contact: martin.renvoize@openfifth.co.uk CC: dpavlin@rot13.org Target Milestone: --- Langauge selection link does not work as expected, if one logs out of Koha and soon logs in again using the login page where one was taken when logging out. 1) Go to Koha, the login page URL is a simple www.example.com 2) Login, and you land on page .../cgi-bin/koha/mainpage.pl. Let us assume that the interface is now in English. 3) Look at the link of a language selection for Finnish in bottom bar: it is .../cgi-bin/koha/changelanguage.pl?language=fi-FI&prepost_referer=https%3A%2F%2Fwww.example.com%2F 4) Click the link, and the interface turns into Finnish. 5) Logout, and you land on page that looks like the login page in step 1 but the URL is .../cgi-bin/koha/mainpage.pl?logout.x=1 6) Login, and you again land on page cgi-bin/koha/mainpage.pl. Let us assume that the interface is again in English. 7) Look at the link of a language selection in bottom bar: it is cgi-bin/koha/changelanguage.pl?language=fi-FI&prepost_referer=https%3A%2F%2Fwww.example.com%2Fcgi-bin%2Fkoha%2Fmainpage.pl%3Flogout.x%3D1 8) Click the link, and you are taken to page .../cgi-bin/koha/mainpage.pl?logout.x=1 What is expected is that the interface turns into Finnish. Language selection using the drop down menu works as expected. Generally, I cannot find any other misbehaving links. If one first clicks any other link on .../cgi-bin/koha/mainpage.pl, the language selection link in the bottom bar works as expected, even when coming back to the home page by using Koha's navigation (i.e. not using browser navigation). -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 E-P Keskitalo <esa-pekka.keskitalo@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gmcharlt@gmail.com QA Contact|martin.renvoize@openfifth.c |testopia@bugs.koha-communit |o.uk |y.org Component|Authentication |Staff interface --- Comment #1 from E-P Keskitalo <esa-pekka.keskitalo@helsinki.fi> --- Possibly related to 23201. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |In Discussion Assignee|koha-bugs@lists.koha-commun |jonathan.druart@gmail.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 --- Comment #2 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 204903 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204903&action=edit Bug 43444: Remove logout.x from referer -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- Hum, I think this fixes correctly your problem, but I am lacking time at the moment to perform more regression tests. Could you confirm it works for you? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nugged@gmail.com --- Comment #4 from Andrii Nugged <nugged@gmail.com> --- checking up -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff --- Comment #5 from Andrii Nugged <nugged@gmail.com> --- I've added this to our pre- and then prods, so sign off will come from our team these days. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |dcook@prosentient.com.au |y.org | CC| |dcook@prosentient.com.au --- Comment #6 from David Cook <dcook@prosentient.com.au> --- (In reply to Andrii Nugged from comment #5)
I've added this to our pre- and then prods, so sign off will come from our team these days.
Sounds good. I'll take a look after that. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|dcook@prosentient.com.au |testopia@bugs.koha-communit | |y.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #7 from David Nind <david@davidnind.com> --- Is this only on 26.05? On main I can't reproduce the issue, or does it need a real URL? Testing notes (using KTD): 1. Install a language: - koha-translate --install de-DE --dev kohadev - Enable Deutsch (de-DE) for the StaffInterfaceLanguages system preference - Restart everything: restart_all 2. Step 3: Not seeing the "&prepost_referer=https%3A%2F%2Fwww.example.com%2F" at the end of the URL for the DEutsch language link- note: using localhost rather than a real domain name, so maybe it requires using a real domain name? 3. Step 5: I am seeing the URL as described 4. Step 6: language defaults back to English 5. Step 6: Not seeing the "&prepost_referer=https%3A%2F%2Fwww.example.com%2Fcgi-bin%2Fkoha%2Fmainpage.pl%3Flogout.x%3D1" at the end of the language link 7. staffClientBaseURL set to http://kohadev-intra.koha-testing:8081 KTD .env settings: KOHA_DOMAIN=.koha-testing KOHA_INSTANCE=kohadev /etc/hosts includes 127.0.0.1 kohadev-intra.koha-testing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 E-P Keskitalo <esa-pekka.keskitalo@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #8 from E-P Keskitalo <esa-pekka.keskitalo@helsinki.fi> --- Tested Nugged's fix. Language selection works as expected. Also, cannot duplicate this in the sandbox. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=23201 CC| |martin.renvoize@openfifth.c | |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=43540 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|26.05 |Main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|tomascohen@gmail.com |martin.renvoize@openfifth.c | |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 --- Comment #9 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Also affects main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #204903|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 --- Comment #10 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 208938 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208938&action=edit Bug 43444: Remove logout.x from referer Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #11 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- QA: Passed. - Confirmed the issue also affects main, not just 26.05: local_referer() does not strip logout.x there either, so changelanguage.pl redirects back to mainpage.pl?logout.x=1. - Note for testers: staffClientBaseURL (or OPACBaseURL) must match the URL you browse from, otherwise local_referer() falls back to '/' and the problem cannot be seen (this is likely why it could not be reproduced on main in comment 7). - The original patch no longer applied to main (bug 43540 changed Navigation.pm/Navigation.t), so I have attached a rebased version. Only change: the plan count in t/Koha/Util/Navigation.t is now 18. - t/Koha/Util/Navigation.t passes, koha-qa.pl passes, and checked live in KTD with the patch applied: referer mainpage.pl?logout.x=1 -> /cgi-bin/koha/mainpage.pl referer catalogue/search.pl?q=perl&logout.x=1&language=de-DE&x=2 -> /cgi-bin/koha/catalogue/search.pl?q=perl&x=2 - No regressions found; other query parameters are preserved. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #208938|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 --- Comment #12 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 208939 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208939&action=edit Bug 43444: Remove logout.x from referer When a librarian logs out of the staff interface, the page they land on has the URL mainpage.pl?logout.x=1. After logging in again from that page the URL still contains logout.x=1, so the language links in the bottom bar are followed with that URL as the referer. changelanguage.pl then redirects back to mainpage.pl?logout.x=1 instead of showing the interface in the chosen language. Koha::Util::Navigation::local_referer now strips the logout.x parameter from the local referer, keeping the rest of the path and query intact. To test: 1. Install a second language (e.g. koha-translate --install de-DE) and enable it in the StaffInterfaceLanguages system preference. 2. Make sure the staffClientBaseURL system preference matches the URL you use to access the staff interface (otherwise the problem is not visible, as the referer is ignored). 3. Log in to the staff interface. 4. Log out. Note the URL is now .../cgi-bin/koha/mainpage.pl?logout.x=1 5. Log in again. 6. Click the language link (e.g. Deutsch) in the bottom bar. => Without the patch you are sent back to mainpage.pl?logout.x=1 and the language does not change. 7. Apply the patch, restart_all, and repeat steps 3-6. => The interface now switches to the chosen language. 8. Confirm the language links still work from other pages, e.g. from a catalogue search results page. 9. Run: prove t/Koha/Util/Navigation.t Signed-off-by: E-P Keskitalo <esa-pekka.keskitalo@helsinki.fi> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43444 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.11.00 released in| | Status|Passed QA |Pushed to main --- Comment #13 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Pushed to main for 26.11. Thanks to everyone involved! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org