X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/c46898c7a2328d211465818380178e25331d8f3c..3f4f01dcd306d7ebb51a1186d722e6aecd237003:/SL/Helper/Csv/Dispatcher.pm diff --git a/SL/Helper/Csv/Dispatcher.pm b/SL/Helper/Csv/Dispatcher.pm index cbcae0d82..add444b9d 100644 --- a/SL/Helper/Csv/Dispatcher.pm +++ b/SL/Helper/Csv/Dispatcher.pm @@ -71,7 +71,19 @@ sub parse_profile { for my $col (@$header) { next unless $col; - push @specs, $self->make_spec($col, $profile->{$col} || $col); + if ($self->_csv->strict_profile) { + if (exists $profile->{$col}) { + push @specs, $self->make_spec($col, $profile->{$col}); + } else { + $self->unknown_column($col, undef); + } + } else { + if (exists $profile->{$col}) { + push @specs, $self->make_spec($col, $profile->{$col}); + } else { + push @specs, $self->make_spec($col, $col); + } + } } $self->_specs(\@specs); @@ -83,8 +95,13 @@ sub make_spec { my ($self, $col, $path) = @_; my $spec = { key => $col, steps => [] }; + + return unless $path; + my $cur_class = $self->_csv->class; + return unless $cur_class; + for my $step_index ( split /\.(?!\d)/, $path ) { my ($step, $index) = split /\./, $step_index; if ($cur_class->can($step)) {