Bug 35935 - Wrong branch picked after an incorrect login
Summary: Wrong branch picked after an incorrect login
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low major
Assignee: Jonathan Druart
QA Contact: Julian Maurice
URL:
Keywords:
Depends on:
Blocks: 34478
  Show dependency treegraph
 
Reported: 2024-01-30 08:01 UTC by Jonathan Druart
Modified: 2024-03-19 15:00 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.04,23.05.10
Circulation function:


Attachments
Bug 35935: Ensure login branch will be used after incorrect login (1.59 KB, patch)
2024-01-30 08:06 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 35935: Ensure login branch will be used after incorrect login (1.67 KB, patch)
2024-01-30 09:03 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 35935: Ensure login branch will be used after incorrect login (1.73 KB, patch)
2024-02-16 09:12 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2024-01-30 08:01:50 UTC
If a different branch is selected after an incorrect login, the previous branch will be used.

To recreate:
* login with foo/bar, select CPL => FAIL
* login with koha/koha, select another branch => OK but CPL is picked!
Comment 1 Jonathan Druart 2024-01-30 08:06:22 UTC Comment hidden (obsolete)
Comment 2 Magnus Enger 2024-01-30 09:03:39 UTC
Created attachment 161625 [details] [review]
Bug 35935: Ensure login branch will be used after incorrect login

If a different branch is selected after an incorrect login, the previous branch will be used.

To recreate:
* login with foo/bar, select CPL => FAIL
* login with koha/koha, select another branch => OK but CPL is picked!

It was caused by a dup of "branch" in CGI param list (and first was picked).

This patch patch also removes "koha_login_context" to not have it twice.
You can also open the source of the page to confirm that form#loginform
contains "branch" and "koha_login_context" in hidden inputs.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Tested in KTD. Works as advertised.
Comment 3 Julian Maurice 2024-02-16 09:12:31 UTC
Created attachment 162236 [details] [review]
Bug 35935: Ensure login branch will be used after incorrect login

If a different branch is selected after an incorrect login, the previous
branch will be used.

To recreate:
* login with foo/bar, select CPL => FAIL
* login with koha/koha, select another branch => OK but CPL is picked!

It was caused by a dup of "branch" in CGI param list (and first was
picked).

This patch patch also removes "koha_login_context" to not have it twice.
You can also open the source of the page to confirm that form#loginform
contains "branch" and "koha_login_context" in hidden inputs.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Tested in KTD. Works as advertised.
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 4 Jonathan Druart 2024-03-01 13:19:58 UTC
Pushed to master for 24.05.00.
Comment 5 Fridolin Somers 2024-03-11 09:02:14 UTC
Pushed to 23.11.x for 23.11.04
Comment 6 Lucas Gass (lukeg) 2024-03-19 15:00:45 UTC
Backported to 23.05.x for upcoming 23.05.10.