Bug 11182: (follow-up) improve initialization of the $waiting_holds variable
authorGalen Charlton <gmc@esilibrary.com>
Tue, 29 Apr 2014 17:55:01 +0000 (17:55 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 29 Apr 2014 17:55:01 +0000 (17:55 +0000)
Rather than check whether it's defined, since its holding an
integer, simply initialize it to 0.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
circ/returns.pl

index 87fe21c..208bb71 100755 (executable)
@@ -283,13 +283,13 @@ if ($barcode) {
         if (C4::Context->preference("WaitingNotifyAtCheckin") ) {
             #Check for waiting holds
             my @reserves = GetReservesFromBorrowernumber($borrower->{'borrowernumber'});
-            my $waiting_holds;
+            my $waiting_holds = 0;
             foreach my $num_res (@reserves) {
                 if ( $num_res->{'found'} eq 'W' && $num_res->{'branchcode'} eq $userenv_branch) {
                     $waiting_holds++;
                 }
             } 
-            if ($waiting_holds && $waiting_holds > 0) {
+            if ($waiting_holds > 0) {
                 $template->param(
                     waiting_holds       => $waiting_holds,
                     holdsborrowernumber => $borrower->{'borrowernumber'},