Further fixes for hold-driven recalls
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 23 Nov 2010 20:58:28 +0000 (20:58 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 23 Nov 2010 20:58:28 +0000 (20:58 +0000)
Force a scalar context on the array reference of circs returned
from the search clause to short-circuit the recall processing
if we have no applicable circs to work through.

Also, open-ils.trigger.event.autocreate needs a Fieldmapper object,
not a raw CDBI object, so invoke the to_fieldmapper() method to
convert it accordingly (thanks to miker for the assist!)

git-svn-id: svn://svn.open-ils.org/ILS/trunk@18837 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm

index b925fd4..53c517a 100644 (file)
@@ -1550,7 +1550,7 @@ sub process_recall {
     )];
 
     # If we have a candidate copy, then:
-    if ($circs) {
+    if (scalar(@$circs)) {
         my $circ = $circs->[0];
         $log->info("Recalling circ ID : " . $circ->id);
 
@@ -1581,7 +1581,7 @@ sub process_recall {
 
         # Create trigger event for notifying current user
         my $ses = OpenSRF::AppSession->create('open-ils.trigger');
-        $ses->request('open-ils.trigger.event.autocreate', 'circ.recall.target', $circ, $circ->circ_lib->id);
+        $ses->request('open-ils.trigger.event.autocreate', 'circ.recall.target', $circ->to_fieldmapper(), $circ->circ_lib->id);
     }
 
     $log->info("Processing of hold ".$hold->id." for recall is now complete.");