From b2930e37cd4bfd276be6c785e1cd7fff0f503aef Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 15 Nov 2012 18:56:45 +0100 Subject: [PATCH] Fehler korrekt weiterleiten --- SL/BackgroundJob/CsvImport.pm | 1 - SL/Controller/CsvImport.pm | 6 +++--- templates/webpages/csv_import/_deferred_results.html | 4 +++- 3 files changed, 6 insertions(+), 5 deletions(-) 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 %]