fix View Holds by preventing an empty IN list with cstore, and stubbing out part_holds
authorJason Etheridge <jason@esilibrary.com>
Mon, 6 Jun 2011 16:46:21 +0000 (12:46 -0400)
committerJason Etheridge <jason@esilibrary.com>
Mon, 6 Jun 2011 17:42:21 +0000 (13:42 -0400)
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm

index ddfd0ad..1be6838 100644 (file)
@@ -2750,7 +2750,7 @@ sub all_rec_holds {
     $args->{fulfillment_time} = undef; #  we don't want to see old fulfilled holds
        $args->{cancel_time} = undef;
 
-       my $resp = { volume_holds => [], copy_holds => [], metarecord_holds => [], issuance_holds => [] };
+       my $resp = { volume_holds => [], copy_holds => [], metarecord_holds => [], part_holds => [], issuance_holds => [] };
 
     my $mr_map = $e->search_metabib_metarecord_source_map({source => $title_id})->[0];
     if($mr_map) {
@@ -2774,12 +2774,14 @@ sub all_rec_holds {
             record => $title_id
         }, {idlist=>1} );
 
-    $resp->{part_holds} = $e->search_action_hold_request(
-        {
-                       hold_type => OILS_HOLD_TYPE_MONOPART,
-                       target => $parts,
-                       %$args
-        }, {idlist=>1} );
+    if (@$parts) {
+        $resp->{part_holds} = $e->search_action_hold_request(
+            {
+                hold_type => OILS_HOLD_TYPE_MONOPART,
+                target => $parts,
+                %$args
+            }, {idlist=>1} );
+    }
 
     my $subs = $e->search_serial_subscription(
         { record_entry => $title_id }, {idlist=>1});