[open-ils-commits] r18416 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger (senator)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Oct 20 15:35:47 EDT 2010
Author: senator
Date: 2010-10-20 15:35:42 -0400 (Wed, 20 Oct 2010)
New Revision: 18416
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm
Log:
Action/trigger: restore the environment-flesher's ability to try reporter-store
if cstore is not among the controllers on a needed class
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm 2010-10-20 17:33:51 UTC (rev 18415)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm 2010-10-20 19:35:42 UTC (rev 18416)
@@ -482,6 +482,7 @@
my $label = shift;
my $path = shift;
my $ed = shift;
+ my $red = shift;
my $outer = 0;
if (!$ed) {
@@ -531,7 +532,11 @@
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 @@
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 @@
}
}
- $ed->rollback if ($outer);
+ if ($outer) {
+ $ed->rollback;
+ $red->rollback if $red;
+ }
return $obj;
}
More information about the open-ils-commits
mailing list