From ba81b3d28ab3c658ef46940c7d860b786355285b 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 https://bugs.koha-community.org/show_bug.cgi?id=11983 --- 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.11.0