From cc6c3f581593e4b9c6e31b5209c95d01f7a30ae4 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 14 Apr 2020 12:00:01 +0200 Subject: [PATCH] Bug 25137: (bug 23084 follow-up) Fix incorrect grep ternary condition The lack of parenthesis makes the condition evaluated wrong. Test plan: - confirm you have a branch with code X - enter X in PatronSelfRegistrationLibraryList - go to cgi-bin/koha/opac-memberentry.pl (either as a logged in patron or as a self-reg patron) - confirm branch dropdown is not empty and contain X - empty out PatronSelfRegistrationLibraryList - reload cgi-bin/koha/opac-memberentry.pl and confirm branches show Signed-off-by: Bernardo Gonzalez Kriegel Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- opac/opac-memberentry.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl index 3f6d8a8735..e954587d81 100755 --- a/opac/opac-memberentry.pl +++ b/opac/opac-memberentry.pl @@ -76,7 +76,11 @@ my $mandatory = GetMandatoryFields($action); my @libraries = Koha::Libraries->search; if ( my @libraries_to_display = split '\|', C4::Context->preference('PatronSelfRegistrationLibraryList') ) { - @libraries = map { my $b = $_; my $branchcode = $_->branchcode; grep { $_ eq $branchcode } @libraries_to_display ? $b : () } @libraries; + @libraries = map { + my $b = $_; + my $branchcode = $_->branchcode; + ( grep { $_ eq $branchcode } @libraries_to_display ) ? $b : () + } @libraries; } my ( $min, $max ) = C4::Members::get_cardnumber_length(); if ( defined $min ) { -- 2.39.5