Bug 7965: Silence warns in staff log
authorChris Cormack <chris@bigballofwax.co.nz>
Fri, 27 Dec 2013 06:06:34 +0000 (19:06 +1300)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 10 Jan 2014 15:42:09 +0000 (15:42 +0000)
Silence warns in C4::Bookseller::GetBooksellersWithLateOrders()

to test
1/ run prove t/db_dependent/Bookseller.t
   Notice lots of Use of uninitialized value $delay in numeric lt (<) at /var/lib/jenkins/jobs/Koha_master/workspace/C4/Bookseller.pm line 134 type lines
2/ apply patch
3/ run prove t/db_dependent/Bookseller.t
   Notice warns are gone

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tiny change, positive consequences.
Passes QA script and all tests.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

C4/Bookseller.pm

index 48f695c..f317719 100644 (file)
@@ -131,7 +131,7 @@ sub GetBooksellersWithLateOrders {
     if ( defined $delay && $delay >= 0 ) {
         $query .= " AND (closedate <= DATE_SUB(CAST(now() AS date),INTERVAL ? + COALESCE(aqbooksellers.deliverytime,0) DAY)) ";
         push @query_params, $delay;
-    } elsif ( $delay < 0 ){
+    } elsif ( $delay && $delay < 0 ){
         warn 'WARNING: GetBooksellerWithLateOrders is called with a negative value';
         return;
     }