X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FCsvImport%2FBase.pm;h=97126979053938ef43f41ee43bb1b37a8f5ddfcb;hb=d402ad9bc8991a0631206930c9c5b238e5586931;hp=0246768d859e27e6c14fedca2208ccc8c61f9a2d;hpb=e41671e06344bfc4a1c5399f1c6014423bd2be29;p=kivitendo-erp.git diff --git a/SL/Controller/CsvImport/Base.pm b/SL/Controller/CsvImport/Base.pm index 0246768d8..971269790 100644 --- a/SL/Controller/CsvImport/Base.pm +++ b/SL/Controller/CsvImport/Base.pm @@ -2,6 +2,7 @@ package SL::Controller::CsvImport::Base; use strict; +use English qw(-no_match_vars); use List::MoreUtils qw(pairwise any); use SL::Helper::Csv; @@ -58,7 +59,7 @@ sub run { $self->controller->raw_data_headers({ used => { }, headers => [ ] }); $self->controller->info_headers({ used => { }, headers => [ ] }); - my @objects = $self->csv->get_objects; + my $objects = $self->csv->get_objects; $self->controller->track_progress(progress => 70); @@ -66,7 +67,7 @@ sub run { $self->controller->track_progress(progress => 80); - $self->controller->data([ pairwise { { object => $a, raw_data => $b, errors => [], information => [], info_data => {} } } @objects, @raw_data ]); + $self->controller->data([ pairwise { { object => $a, raw_data => $b, errors => [], information => [], info_data => {} } } @$objects, @raw_data ]); $self->controller->track_progress(progress => 90); @@ -461,9 +462,9 @@ sub save_objects { my $ret; if (!eval { $ret = $object->save(cascade => !!$self->save_with_cascade()); 1 }) { - push @{ $entry->{errors} }, $::locale->text('Error when saving: #1', $@); + push @{ $entry->{errors} }, $::locale->text('Error when saving: #1', $EVAL_ERROR); } elsif ( !$ret ) { - push @{ $entry->{errors} }, $::locale->text('Error when saving: #1', $entry->{object}->db->error); + push @{ $entry->{errors} }, $::locale->text('Error when saving: #1', $object->db->error); } else { $self->_save_history($object); $self->controller->num_imported($self->controller->num_imported + 1);