Bug 5549 Fix a couple of comparisons in C4::Circulation
authorColin Campbell <colin.campbell@ptfs-europe.com>
Thu, 23 Jun 2011 11:10:51 +0000 (12:10 +0100)
committerChris Cormack <chrisc@catalyst.net.nz>
Tue, 20 Mar 2012 00:25:05 +0000 (13:25 +1300)
Changed a string comparison called on an integer
Deal with case where value is not set without runtime warnings

C4/Circulation.pm

index 41d60dd..bbff8ae 100644 (file)
@@ -793,7 +793,7 @@ sub CanBookBeIssued {
     #
        my ($current_loan_count, $max_loans_allowed) = TooMany( $borrower, $item->{biblionumber}, $item );
     # if TooMany max_loans_allowed returns 0 the user doesn't have permission to check out this book
-    if ($max_loans_allowed eq 0) {
+    if (defined $max_loans_allowed && $max_loans_allowed == 0) {
         $needsconfirmation{PATRON_CANT} = 1;
     } else {
         if($max_loans_allowed){