From 526173c2827375e04540a626a339d249a3648239 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 15 May 2009 17:49:34 +0000 Subject: [PATCH] Latex Parser: MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit if innerhalb von foreach schlägt fehl, wenn die Variable im neuen TEMPLATE_ARRAY Format abgelegt ist. if muss also auch dort suchen. Fix für Bug 992. --- SL/Template.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/SL/Template.pm b/SL/Template.pm index 4cbde74e6..8300458b7 100644 --- a/SL/Template.pm +++ b/SL/Template.pm @@ -223,9 +223,9 @@ sub parse_foreach { $sum += $form->parse_amount($self->{"myconfig"}, $form->{"linetotal"}->[$i]); } - + $form->{"cumulatelinetotal"}[$i] = $form->format_amount($self->{"myconfig"}, $sum, 2); - + my $new_text = $self->parse_block($text, (@indices, $i)); return undef unless (defined($new_text)); $new_contents .= $start_tag . $new_text . $end_tag; @@ -350,7 +350,11 @@ sub parse_block { return undef; } - my $value = $self->{"form"}->{$var}; + my $form = $self->{form}; + $form = $form->{TEMPLATE_ARRAYS} if @indices + && ref $form->{TEMPLATE_ARRAYS} eq 'HASH' + && ref $form->{TEMPLATE_ARRAYS}->{$var} eq 'ARRAY'; + my $value = $form->{$var}; for (my $i = 0; $i < scalar(@indices); $i++) { last unless (ref($value) eq "ARRAY"); $value = $value->[$indices[$i]]; @@ -1365,7 +1369,7 @@ sub uses_temp_file { #### ########################################################## -package XMLTemplate; +package XMLTemplate; use vars qw(@ISA); -- 2.20.1