From: miker Date: Wed, 8 Sep 2010 22:34:16 +0000 (+0000) Subject: Check for empty-ok after testing issuance copies in addition to when there are no... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2db95c888a433612c33365a3ca5234cf6dea2a2c;p=evergreen%2Fbjwebb.git Check for empty-ok after testing issuance copies in addition to when there are no copies to test git-svn-id: svn://svn.open-ils.org/ILS/trunk@17529 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm index 1d2817ed0..d667164cf 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm @@ -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; }