X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FHelper%2FCsv%2FDispatcher.pm;h=be3faddd63d5561c78f5703c4511e6b8961f2879;hb=dc3f6120f9bbacaa028e554d7fa71e481d4497b4;hp=cbcae0d82d87e192ecc362de02bac5235ff62537;hpb=c46898c7a2328d211465818380178e25331d8f3c;p=kivitendo-erp.git diff --git a/SL/Helper/Csv/Dispatcher.pm b/SL/Helper/Csv/Dispatcher.pm index cbcae0d82..be3faddd6 100644 --- a/SL/Helper/Csv/Dispatcher.pm +++ b/SL/Helper/Csv/Dispatcher.pm @@ -71,7 +71,15 @@ 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 { + push @specs, $self->make_spec($col, $profile->{$col} || $col); + } } $self->_specs(\@specs); @@ -85,6 +93,8 @@ sub make_spec { my $spec = { key => $col, steps => [] }; 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)) {