[open-ils-commits] r17904 - in branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application: . Trigger (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Sep 22 22:13:22 EDT 2010
Author: miker
Date: 2010-09-22 22:13:19 -0400 (Wed, 22 Sep 2010)
New Revision: 17904
Modified:
branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm
branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm
Log:
Backport r17903 from trunk: only flesh up to, but not including, the leaf for the group_field
Modified: branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm
===================================================================
--- branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm 2010-09-23 02:12:02 UTC (rev 17903)
+++ branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm 2010-09-23 02:13:19 UTC (rev 17904)
@@ -397,7 +397,8 @@
if ($self->event->event_def->group_field) {
my @group_path = split(/\./, $self->event->event_def->group_field);
- my $group_object = $self->_object_by_path( $self->target, undef, [], \@group_path );
+ pop(@group_path); # the last part is a field, should not get fleshed
+ my $group_object = $self->_object_by_path( $self->target, undef, [], \@group_path ) if (@group_path);
}
$self->environment->{complete} = 1;
Modified: branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm
===================================================================
--- branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm 2010-09-23 02:12:02 UTC (rev 17903)
+++ branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm 2010-09-23 02:13:19 UTC (rev 17904)
@@ -656,16 +656,16 @@
# split the grouping link steps
my @steps = split /\./, $group;
+ my $group_field = pop(@steps); # we didn't flesh to this, it's a field not an object
# find the grouping object
my $node = $e->target;
$node = $node->$_() for ( @steps );
- # get the pkey value for the grouping object on this event
- my $node_ident = $node->Identity;
- my $ident_value = $node->$node_ident();
+ # get the grouping value for the grouping object on this event
+ my $ident_value = $node->$group_field();
- # push this event onto the event+grouping_pkey_value stack
+ # push this event onto the event+grouping_value stack
$groups{$e->event->event_def->id}{$ident_value} ||= [];
push @{ $groups{$e->event->event_def->id}{$ident_value} }, $e;
} else {
More information about the open-ils-commits
mailing list