From 61522d06f138cd4280301c05e54e35c44914770c Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 9 Jul 2013 14:30:14 +0000 Subject: [PATCH] Bug 9394: (follow-up) silence spurious warns One just needed parentheses, but the one on line 219 reflects a slightly deeper problem -- it's running patron checks when a patron hasn't actually been supplied. To test: [1] From the staff interface, bring up a biblio that has no holds on it, then go to the holds tab. [2] Verify that the Apache log has no new warnings containing: request.pl: Use of uninitialized value in string eq at /home/gmc/koha/reserve/request.pl line 219 or request.pl: Use of uninitialized value in string eq at /home/gmc/koha/reserve/request.pl line 488 Signed-off-by: Galen Charlton Signed-off-by: Chris Cormack Signed-off-by: Galen Charlton --- reserve/request.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reserve/request.pl b/reserve/request.pl index d303e68273..11741e2c24 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -216,7 +216,7 @@ foreach my $biblionumber (@biblionumbers) { $count--; } - if ( defined $borrowerinfo && ($borrowerinfo->{borrowernumber} eq $res->{borrowernumber}) ) { + if ( defined $borrowerinfo && defined($borrowerinfo->{borrowernumber}) && ($borrowerinfo->{borrowernumber} eq $res->{borrowernumber}) ) { $holds_count++; } } @@ -485,7 +485,7 @@ foreach my $biblionumber (@biblionumbers) { ); } - if ( defined $res->{'found'} && $res->{'found'} eq 'W' || $res->{'found'} eq 'T' ) { + if ( defined $res->{'found'} && ($res->{'found'} eq 'W' || $res->{'found'} eq 'T' )) { my $item = $res->{'itemnumber'}; $item = GetBiblioFromItemNumber($item,undef); $reserve{'wait'}= 1; -- 2.39.5