LP#1410369: fix (old) thinko in A/T environment builder
authorGalen Charlton <gmc@esilibrary.com>
Fri, 20 Feb 2015 17:15:59 +0000 (17:15 +0000)
committerBill Erickson <berickxx@gmail.com>
Fri, 20 Feb 2015 21:58:18 +0000 (16:58 -0500)
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>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
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} ||= {};