LP#1284864 repair MR hold possibilty depth calculation
authorBill Erickson <berick@esilibrary.com>
Tue, 4 Mar 2014 15:42:22 +0000 (10:42 -0500)
committerMike Rylander <mrylander@gmail.com>
Mon, 10 Mar 2014 16:29:52 +0000 (12:29 -0400)
Fixes a bug where the hold possibility checks for metarecords used the
depth of the selection OU instead of depth 0 when no depth was defined.
This prevented holds from being placed in some instances, particularly
when no hold boundaries were defined (or equaled zero).

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm

index 3bf2157..45b2133 100644 (file)
@@ -2477,6 +2477,9 @@ sub do_possibility_checks {
 
     } elsif( $hold_type eq OILS_HOLD_TYPE_METARECORD ) {
 
+        # pasing undef as the depth to filtered_records causes the depth
+        # of the selection_ou to be used, which is not what we want here.
+        $depth ||= 0;
 
         my ($recs) = __PACKAGE__->method_lookup('open-ils.circ.holds.metarecord.filtered_records')->run($mrid, $holdable_formats, $selection_ou, $depth);
         my @status = ();