LP#1410369: fix (old) thinko in A/T environment builder collab/gmcharlt/lp1410369_message_center
authorGalen Charlton <gmc@esilibrary.com>
Fri, 20 Feb 2015 17:15:59 +0000 (17:15 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 20 Feb 2015 17:15:59 +0000 (17:15 +0000)
If a label is set for a piece of the environment, e.g.,
[qw/foo bar/], ensure that we end up with $self->environment->{foo}{bar},
not $self->environment->{foo}{bar}{bar}

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Event.pm

index bcb7558..91c7994 100644 (file)
@@ -664,7 +664,7 @@ sub _object_by_path {
 
         if ($label && @$label) {
             my $node = $self->environment;
-            my $i = 0; my $max = scalar(@$label);
+            my $i = 0; my $max = scalar(@$label) - 1;
             for (; $i < $max; $i++) {
                 my $part = $$label[$i];
                 $$node{$part} ||= {};