Bug 27604: (QA follow-up) Limit the libraries during the query

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 60a749ff5a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1951169055)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
This commit is contained in:
Nick Clemens 2021-02-05 17:29:54 +00:00 committed by Andrew Fuerste-Henry
parent cd8fd0bb45
commit ec0cee795f
1 changed files with 3 additions and 9 deletions

View File

@ -74,18 +74,12 @@ if ( $action eq q{} ) {
my $mandatory = GetMandatoryFields($action);
my @libraries = Koha::Libraries->search;
my $params = undef;
if ( $action eq 'create' || $action eq 'new' ) {
my @PatronSelfRegistrationLibraryList = split '\|', C4::Context->preference('PatronSelfRegistrationLibraryList');
if (@PatronSelfRegistrationLibraryList) {
@libraries = map {
my $l = $_;
( grep { $l->branchcode eq $_ } @PatronSelfRegistrationLibraryList )
? $l
: ()
} @libraries;
}
$params = { branchcode => { -in => \@PatronSelfRegistrationLibraryList } };
}
my @libraries = Koha::Libraries->search($params);
my ( $min, $max ) = C4::Members::get_cardnumber_length();
if ( defined $min ) {