in batches, 'event' is an array of events
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 31 Mar 2009 20:56:25 +0000 (20:56 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 31 Mar 2009 20:56:25 +0000 (20:56 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12744 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Trigger/Reactor.pm

index 9299a6e..0257d92 100644 (file)
@@ -83,7 +83,9 @@ sub run_TT {
 
         $env->{EventProcessor}->editor->xact_begin;
         $t_o = $env->{EventProcessor}->editor->create_action_trigger_template_output( $t_o );
-        $env->{EventProcessor}->update_state( $env->{event}->state, { template_output => $t_o->id } );
+
+        my $state = (ref $$env{event} eq 'ARRAY') ? $$env{event}->[0]->state : $env->{event}->state;
+        $env->{EventProcessor}->update_state( $state, { template_output => $t_o->id } );
     }
        
     return $output;