From 665c8328d11cb3ff83c9b48e25bc583757daaf7d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 16 Apr 2020 11:51:32 +0200 Subject: [PATCH] Bug 25136: Join the 2 ifs Highlight that we only need this for action="new" Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- opac/opac-memberentry.pl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl index 05241589b6..f657b127a4 100755 --- a/opac/opac-memberentry.pl +++ b/opac/opac-memberentry.pl @@ -75,14 +75,14 @@ if ( $action eq q{} ) { my $mandatory = GetMandatoryFields($action); my @libraries = Koha::Libraries->search; -if ( my @libraries_to_display = split '\|', C4::Context->preference('PatronSelfRegistrationLibraryList') ) { - if ( $action eq 'new' ) { - @libraries = map { - my $b = $_; - my $branchcode = $_->branchcode; - ( grep { $_ eq $branchcode } @libraries_to_display ) ? $b : () - } @libraries; - } +if ( $action eq 'new' + && ( my @libraries_to_display = split '\|', C4::Context->preference('PatronSelfRegistrationLibraryList') ) +) { + @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