LP#1308239 precat holds fulfillment logic repair
authorBill Erickson <berick@esilibrary.com>
Tue, 29 Jul 2014 19:11:44 +0000 (15:11 -0400)
committerJason Stephenson <jstephenson@mvlc.org>
Tue, 29 Jul 2014 20:18:06 +0000 (16:18 -0400)
In cases where there is no hold on a precat copy, avoid trying to find
"related" holds, in part because it's unnecessary, but also because the
implementation assumes a fleshed $self->volume object, which is not
present during precat checkout.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm

index 896102d..f37c0fb 100644 (file)
@@ -1792,7 +1792,9 @@ sub find_related_user_hold {
     my($self, $copy, $patron) = @_;
     my $e = $self->editor;
 
-    return undef if $self->volume->id == OILS_PRECAT_CALL_NUMBER; 
+    # holds on precat copies are always copy-level, so this call will
+    # always return undef.  Exit early.
+    return undef if $self->is_precat;
 
     return undef unless $U->ou_ancestor_setting_value(        
         $self->circ_lib, 'circ.checkout_fills_related_hold', $e);