Check for empty-ok after testing issuance copies in addition to when there are no...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 8 Sep 2010 22:34:16 +0000 (22:34 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 8 Sep 2010 22:34:16 +0000 (22:34 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@17529 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm

index 1d2817e..d667164 100644 (file)
@@ -2074,8 +2074,9 @@ sub _check_issuance_hold_is_possible {
 
     $logger->info("issuance possible found ".scalar(@$copies)." potential copies");
 
+    my $empty_ok;
     if (!@$copies) {
-        my $empty_ok = $e->retrieve_config_global_flag('circ.holds.empty_issuance_ok');
+        $empty_ok = $e->retrieve_config_global_flag('circ.holds.empty_issuance_ok');
         $empty_ok = ($empty_ok and $U->is_true($empty_ok->enabled));
 
         return (
@@ -2166,6 +2167,14 @@ sub _check_issuance_hold_is_possible {
       }
     }
 
+    if (!$status[0]) {
+        if (!defined($empty_ok)) {
+            $empty_ok = $e->retrieve_config_global_flag('circ.holds.empty_issuance_ok');
+            $empty_ok = ($empty_ok and $U->is_true($empty_ok->enabled));
+        }
+
+        return (1,0) if ($empty_ok);
+    }
     return @status;
 }