From 4b84cde9b898dc2e69cf67584f17f201a0f4ba2a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Wed, 13 Mar 2013 09:55:28 +0100 Subject: [PATCH] Rose-Fehler beim Speichern eines Objekts anzeigen lassen. Siehe Bug #2203. Siehe auch commit d16fc161b610f2ba59025fee1db94511a0c6c5cd Rose-Fehler beim Speichern eines Objekts anzeigen lassen. Return-Werte im eval-Aufruf richtig behandeln. Betrifft #2203. --- SL/Controller/CsvImport/Base.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SL/Controller/CsvImport/Base.pm b/SL/Controller/CsvImport/Base.pm index 92ee5565c..6390e7d04 100644 --- a/SL/Controller/CsvImport/Base.pm +++ b/SL/Controller/CsvImport/Base.pm @@ -416,7 +416,10 @@ sub save_objects { my $object = $entry->{object_to_save} || $entry->{object}; - if ( !$object->save(cascade => !!$self->save_with_cascade()) ) { + my $ret; + if (!eval { $ret = $object->save(cascade => !!$self->save_with_cascade()); 1 }) { + push @{ $entry->{errors} }, $::locale->text('Error when saving: #1', $@); + } elsif ( !$ret ) { push @{ $entry->{errors} }, $::locale->text('Error when saving: #1', $entry->{object}->db->error); } else { $self->_save_history($object); -- 2.20.1