From d14f72e7f3ce339b7565e27fcb169181ff90d64b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 19 Nov 2012 10:38:54 +0100 Subject: [PATCH] nicht hochgeladene Datei abfangen --- SL/Controller/CsvImport.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SL/Controller/CsvImport.pm b/SL/Controller/CsvImport.pm index 8834b2024..23f333263 100644 --- a/SL/Controller/CsvImport.pm +++ b/SL/Controller/CsvImport.pm @@ -250,6 +250,12 @@ sub test_and_import_deferred { $file->fh->close; } + my $file = SL::SessionFile->new($self->csv_file_name, mode => '<', encoding => $self->profile->get('charset')); + if (!$file->fh) { + flash('error', $::locale->text('No file has been uploaded yet.')); + return $self->action_new; + } + $self->{background_job} = SL::BackgroundJob::CsvImport->create_job( file => $self->csv_file_name, profile => $self->profile, -- 2.20.1