From 19511690558dbd81095754d78c7eeb94937f2768 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 5 Feb 2021 17:29:54 +0000 Subject: [PATCH] Bug 27604: (QA follow-up) Limit the libraries during the query Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart (cherry picked from commit 60a749ff5a6ab1e7bbbcc28d7db69bdca51b2eed) Signed-off-by: Fridolin Somers --- opac/opac-memberentry.pl | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl index c51a18eafa..5c9fe6120b 100755 --- a/opac/opac-memberentry.pl +++ b/opac/opac-memberentry.pl @@ -75,18 +75,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 ) { -- 2.39.5