moved the cache clear to later in the firing to pick up data; fixed some typos/thinkos
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 3 Oct 2010 15:06:45 +0000 (15:06 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 3 Oct 2010 15:06:45 +0000 (15:06 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@18140 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index ec675a7..604215a 100644 (file)
@@ -539,7 +539,6 @@ sub fire_single_event {
     my $event_id = shift;
 
     my $e = OpenILS::Application::Trigger::Event->new($event_id);
-    OpenILS::Application::Trigger::Event->ClearObjectCache();
 
     if ($e->validate->valid) {
         $logger->info("trigger: Event is valid, reacting...");
@@ -547,6 +546,7 @@ sub fire_single_event {
     }
 
     $e->editor->disconnect;
+    OpenILS::Application::Trigger::Event->ClearObjectCache();
 
     return {
         valid     => $e->valid,
@@ -568,7 +568,6 @@ sub fire_event_group {
     my $events = shift;
 
     my $e = OpenILS::Application::Trigger::EventGroup->new(@$events);
-    OpenILS::Application::Trigger::Event->ClearObjectCache();
 
     if ($e->validate->valid) {
         $logger->info("trigger: Event group is valid, reacting...");
@@ -576,6 +575,7 @@ sub fire_event_group {
     }
 
     $e->editor->disconnect;
+    OpenILS::Application::Trigger::Event->ClearObjectCache();
 
     return {
         valid     => $e->valid,
index 74ccf75..154bce9 100644 (file)
@@ -449,11 +449,11 @@ sub ClearObjectCache {
     for my $did ( keys %_object_by_path_cache ) {
         my $phash = $_object_by_path_cache{$did};
         for my $path ( keys %$phash ) {
-            my $shash = $phash{$path};
+            my $shash = $$phash{$path};
             for my $step ( keys %$shash ) {
-                my $fhash = $shash{$step};
+                my $fhash = $$shash{$step};
                 for my $ffield ( keys %$fhash ) {
-                    my $lhash = $fhash{$ffield};
+                    my $lhash = $$fhash{$ffield};
                     for my $lfield ( keys %$lhash ) {
                         delete $$lhash{$lfield};
                     }
@@ -525,7 +525,7 @@ sub _object_by_path {
                     $context->$lfield()
             );
 
-        $_object_by_path_cache{$self->event->event_def->id}{join('.',@$path)}{$ffield}{$context->$lfield()} ||= $obj;
+        $_object_by_path_cache{$self->event->event_def->id}{join('.',@$path)}{$step}{$ffield}{$context->$lfield()} ||= $obj;
 
         if ($self->standalone) {
             $ed->xact_rollback || return undef;