From 04928195a546083d758709a10e9a5c7ae2272554 Mon Sep 17 00:00:00 2001 From: erickson Date: Sun, 3 Oct 2010 15:06:45 +0000 Subject: [PATCH] moved the cache clear to later in the firing to pick up data; fixed some typos/thinkos git-svn-id: svn://svn.open-ils.org/ILS/trunk@18140 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm | 4 ++-- Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm b/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm index ec675a7a3e..604215a062 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm @@ -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, diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm b/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm index 74ccf75448..154bce9c02 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm @@ -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; -- 2.11.0