From 7eaf45a5d2ac3b81601a6a7e8b569e20febde4df Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Sat, 30 Aug 2014 00:06:51 +0200 Subject: [PATCH] CsvImport: Fehler beim Speichern vom richtigem Objekt anzeigen. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Und "use English" (EVAL_ERROR) für bessere Lesbarkeit. --- SL/Controller/CsvImport/Base.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); -- 2.20.1