From: Sven Schöling Date: Thu, 15 Nov 2012 17:56:45 +0000 (+0100) Subject: Fehler korrekt weiterleiten X-Git-Tag: release-3.1.0beta1~728 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=b2930e37cd4bfd276be6c785e1cd7fff0f503aef;p=kivitendo-erp.git Fehler korrekt weiterleiten --- diff --git a/SL/BackgroundJob/CsvImport.pm b/SL/BackgroundJob/CsvImport.pm index 030017964..98aed9c37 100644 --- a/SL/BackgroundJob/CsvImport.pm +++ b/SL/BackgroundJob/CsvImport.pm @@ -89,7 +89,6 @@ sub do_import { if ($c->errors) { $job->set_data( errors => $c->errors, - progress => -1, )->save; } else { diff --git a/SL/Controller/CsvImport.pm b/SL/Controller/CsvImport.pm index 9704566d6..681ebdd47 100644 --- a/SL/Controller/CsvImport.pm +++ b/SL/Controller/CsvImport.pm @@ -93,10 +93,10 @@ sub action_result { flash('error', $::locale->text('There was an error parsing the csv file: #1 in line #2.', $first_error->[2], $first_error->[0])); } - if (!$data->{progress}{finished}) { - $self->render('csv_import/_deferred_results', { no_layout => 1 }); - } else { + if ($data->{progress}{finished} || $data->{errors}) { $self->action_report(report_id => $data->{report_id}, no_layout => 1); + } else { + $self->render('csv_import/_deferred_results', { no_layout => 1 }); } } diff --git a/templates/webpages/csv_import/_deferred_results.html b/templates/webpages/csv_import/_deferred_results.html index bc6d68379..050ca5ade 100644 --- a/templates/webpages/csv_import/_deferred_results.html +++ b/templates/webpages/csv_import/_deferred_results.html @@ -5,8 +5,10 @@

[% 'Import Status' | $T8 %]

[% PROCESS 'common/flash.html' %] +[% UNLESS SELF.background_job.data_as_hash.errors %]
+[% END %]