# 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 {
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;