From: senator Date: Tue, 1 Jun 2010 21:04:39 +0000 (+0000) Subject: Make in-db hold checking consistent with circulation when it comes to X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=97def50370eabddc90f536b8393a3753fa4b5b35;p=contrib%2FConifer.git Make in-db hold checking consistent with circulation when it comes to returning events with fail_part set. git-svn-id: svn://svn.open-ils.org/ILS/trunk@16552 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Utils/PermitHold.pm b/Open-ILS/src/perlmods/OpenILS/Utils/PermitHold.pm index 0dc2ef4754..f0e6b74c68 100644 --- a/Open-ILS/src/perlmods/OpenILS/Utils/PermitHold.pm +++ b/Open-ILS/src/perlmods/OpenILS/Utils/PermitHold.pm @@ -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 + ]; }