Browse Source

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 <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
20.05.x
Martin Renvoize 3 years ago
parent
commit
1069bc2405
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 2
      C4/Reserves.pm

2
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 {

Loading…
Cancel
Save