Make in-db hold checking consistent with circulation when it comes to
authorsenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 1 Jun 2010 21:04:39 +0000 (21:04 +0000)
committersenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 1 Jun 2010 21:04:39 +0000 (21:04 +0000)
returning events with fail_part set.

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

Open-ILS/src/perlmods/OpenILS/Utils/PermitHold.pm

index 0dc2ef4..f0e6b74 100644 (file)
@@ -232,10 +232,15 @@ sub indb_hold_permit {
     return [OpenILS::Event->new('NO_POLICY_MATCHPOINT')] unless @$results;
     return [] if $U->is_true($results->[0]->{success});
 
-    my @events;
-    push(@events, OpenILS::Event->new(
-        $LEGACY_HOLD_EVENT_MAP->{$_->{fail_part}})) for @$results;
-    return \@events;
+    return [
+        map {
+            my $event = new OpenILS::Event(
+                $LEGACY_HOLD_EVENT_MAP->{$_->{"fail_part"}} || $_->{"fail_part"}
+            );
+            $event->{"payload"} = {"fail_part" => $_->{"fail_part"}};
+            $event;
+        } @$results
+    ];
 }