From 1069bc240525f72d1e06bb9b78ef55fbec6dad2e Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 29 Jan 2020 13:18:20 +0000 Subject: [PATCH] Bug 24529: Silence warnings for title level holds This patch simply adds a test for itemnumber being defined in the reserve before comparing it to silence the warning. Test plan: 1) Prior to patch, run prove t/db_dependant/Circulation.t and note lots of `Use of uninitialized value in numeric eq (==) at /kohadevbox/koha/C4/Reserves.pm line 790` warnings. 2) Apply the patch, re-run the test and note the tests still pass but the warnings are now gone. Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- C4/Reserves.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index db910a0c04..be869012f5 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -787,7 +787,7 @@ sub CheckReserves { my $priority = 10000000; foreach my $res (@reserves) { - if ( $res->{'itemnumber'} == $itemnumber && $res->{'priority'} == 0) { + if ( $res->{'itemnumber'} && $res->{'itemnumber'} == $itemnumber && $res->{'priority'} == 0) { if ($res->{'found'} eq 'W') { return ( "Waiting", $res, \@reserves ); # Found it, it is waiting } else { -- 2.39.5