[open-ils-commits] r17978 - trunk/Open-ILS/src/perlmods/OpenILS/Application (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Sep 24 18:24:04 EDT 2010
Author: erickson
Date: 2010-09-24 18:23:58 -0400 (Fri, 24 Sep 2010)
New Revision: 17978
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
Log:
clean up the fire_object_events cstore xact
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm 2010-09-24 20:55:14 UTC (rev 17977)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm 2010-09-24 22:23:58 UTC (rev 17978)
@@ -1634,7 +1634,7 @@
if($event_def) {
$def = $e->retrieve_action_trigger_event_definition($event_def)
- or return $e->event;
+ or return $e->die_event;
$auto_method .= '.include_inactive';
@@ -1642,9 +1642,11 @@
# find the most appropriate event def depending on context org
$def = $self->find_event_def_by_hook($hook, $context_org, $e)
- or return $e->event;
+ or return $e->die_event;
}
+ my $final_resp;
+
if($def->group_field) {
# we have a list of objects
$object = [$object] unless ref $object eq 'ARRAY';
@@ -1675,12 +1677,13 @@
);
}
- return undef unless $resp and $resp->{events} and @{$resp->{events}};
+ if($resp and $resp->{events} and @{$resp->{events}}) {
- return $e->retrieve_action_trigger_event([
- $resp->{events}->[0]->id,
- {flesh => 1, flesh_fields => {atev => ['template_output', 'error_output']}}
- ]);
+ $final_resp = $e->retrieve_action_trigger_event([
+ $resp->{events}->[0]->id,
+ {flesh => 1, flesh_fields => {atev => ['template_output', 'error_output']}}
+ ]);
+ }
} else {
@@ -1714,13 +1717,17 @@
$event_id
);
}
- return undef unless $resp and $resp->{event};
+
+ if($resp and $resp->{event}) {
+ $final_resp = $e->retrieve_action_trigger_event([
+ $resp->{event}->id,
+ {flesh => 1, flesh_fields => {atev => ['template_output', 'error_output']}}
+ ]);
+ }
+ }
- return $e->retrieve_action_trigger_event([
- $resp->{event}->id,
- {flesh => 1, flesh_fields => {atev => ['template_output', 'error_output']}}
- ]);
- }
+ $e->rollback;
+ return $final_resp;
}
More information about the open-ils-commits
mailing list