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 <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2020-04-14 12:00:01 +02:00 committed by Martin Renvoize
parent 909e172c17
commit cc6c3f5815
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

View file

@ -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 ) {