From 0fbebbef8dda5ad51cc2001cb52c4e47781e008a Mon Sep 17 00:00:00 2001 From: senator Date: Wed, 20 Oct 2010 19:35:42 +0000 Subject: [PATCH] Action/trigger: restore the environment-flesher's ability to try reporter-store if cstore is not among the controllers on a needed class git-svn-id: svn://svn.open-ils.org/ILS/trunk@18416 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm b/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm index 2ec5d1be6..de11a15ea 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm @@ -482,6 +482,7 @@ sub _object_by_path { my $label = shift; my $path = shift; my $ed = shift; + my $red = shift; my $outer = 0; if (!$ed) { @@ -531,7 +532,11 @@ sub _object_by_path { my $str_path = join('.', @$path); $obj = $_object_by_path_cache{$def_id}{$str_path}{$step}{$ffield}{$lval} || - $ed->$meth( ($multi) ? { $ffield => $lval } : $lval); + ( + (grep /cstore/, @{ + Fieldmapper->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; } @@ -548,7 +553,7 @@ sub _object_by_path { for (@$obj_list) { my @path_clone = @$path; - $self->_object_by_path( $_, $collector, $label, \@path_clone, $ed ); + $self->_object_by_path( $_, $collector, $label, \@path_clone, $ed, $red ); } $obj = $$obj_list[0] if (!$multi || $rtype eq 'might_have'); @@ -591,7 +596,10 @@ sub _object_by_path { } } - $ed->rollback if ($outer); + if ($outer) { + $ed->rollback; + $red->rollback if $red; + } return $obj; } -- 2.11.0