Fix A/T object cache
authorThomas Berezansky <tsbere@mvlc.org>
Thu, 1 Nov 2012 13:08:38 +0000 (09:08 -0400)
committerMike Rylander <mrylander@gmail.com>
Thu, 22 Aug 2013 15:32:04 +0000 (11:32 -0400)
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Event.pm

index 0f52b73..b0be015 100644 (file)
@@ -496,16 +496,20 @@ sub ClearObjectCache {
         my $phash = $_object_by_path_cache{$did};
         for my $path ( keys %$phash ) {
             my $shash = $$phash{$path};
-            for my $step ( keys %$shash ) {
-                my $fhash = $$shash{$step};
-                for my $ffield ( keys %$fhash ) {
-                    my $lhash = $$fhash{$ffield};
-                    for my $lfield ( keys %$lhash ) {
-                        delete $$lhash{$lfield};
+            for my $fhint ( keys %$shash ) {
+                my $hhash = $$shash{$fhint};
+                for my $step ( keys %$hhash ) {
+                    my $fhash = $$hhash{$step};
+                    for my $ffield ( keys %$fhash ) {
+                        my $lhash = $$fhash{$ffield};
+                        for my $lfield ( keys %$lhash ) {
+                            delete $$lhash{$lfield};
+                        }
+                        delete $$fhash{$ffield};
                     }
-                    delete $$fhash{$ffield};
+                    delete $$hhash{$step};
                 }
-                delete $$shash{$step};
+                delete $$shash{$fhint};
             }
             delete $$phash{$path};
         }
@@ -569,14 +573,14 @@ sub _object_by_path {
             my $def_id = $self->event->event_def->id;
             my $str_path = join('.', @$path);
 
-            $obj = $_object_by_path_cache{$def_id}{$str_path}{$step}{$ffield}{$lval} ||
+            $obj = $_object_by_path_cache{$def_id}{$str_path}{$fhint}{$step}{$ffield}{$lval} ||
                 (
                     (grep /cstore/, @{
                         OpenILS::Application->publish_fieldmapper->{$fclass}{controller}
                     }) ? $ed : ($red ||= new_rstore_editor(xact=>1))
                 )->$meth( ($multi) ? { $ffield => $lval } : $lval);
 
-            $_object_by_path_cache{$def_id}{$str_path}{$step}{$ffield}{$lval} ||= $obj;
+            $_object_by_path_cache{$def_id}{$str_path}{$fhint}{$step}{$ffield}{$lval} ||= $obj;
         }
     }