]> git.koha-community.org Git - koha.git/commit
Bug 36908: Additional unit tests to identify flaw when two branches have same IP
authorNick Clemens <nick@bywatersolutions.com>
Tue, 21 May 2024 12:26:34 +0000 (12:26 +0000)
committerLucas Gass <lucas@bywatersolutions.com>
Fri, 31 May 2024 15:24:39 +0000 (15:24 +0000)
commitde8052609f7731193dbc341293a49edc0478087d
tree95f248cd95f3dfa5c68f2c4983067beab4377e81
parent7925e6e0f726048d352cc0908e93e32d2a9ca8b9
Bug 36908: Additional unit tests to identify flaw when two branches have same IP

This could be considered a configuration flaw, but when:
StaffLoginBranchBasedOnIP enabled and not AutoLocation
or
AutoLocation enabledand no IP set in user's branch

AND

two branches have the same IP set

the user can be logged in randomly to one of the matching branches.

These test often pass, but will also randomly fail

Easier to verify with a one liner demonstrating current code:
perl -e 'use Koha::Libraries; use List::MoreUtils qw(uniq); my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search->as_list }; my $branchcode="CPL"; warn Data::Dumper::Dumper( uniq( $branchcode, keys %$branches ));'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7e8803537254ec950c64327bece8091e6cf49499)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit aa1c4c0281039749fa024687049b32b375d78ec6)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
t/db_dependent/Auth.t