From: Bernd Bleßmann Date: Fri, 29 Aug 2014 22:06:51 +0000 (+0200) Subject: CsvImport: Fehler beim Speichern vom richtigem Objekt anzeigen. X-Git-Tag: release-3.2.0beta~325^2~1 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=7eaf45a5d2ac3b81601a6a7e8b569e20febde4df;p=kivitendo-erp.git CsvImport: Fehler beim Speichern vom richtigem Objekt anzeigen. Und "use English" (EVAL_ERROR) für bessere Lesbarkeit. --- diff --git a/SL/Controller/CsvImport/Base.pm b/SL/Controller/CsvImport/Base.pm index 0246768d8..c94f1bac3 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; @@ -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);