From: Bernd Bleßmann Date: Mon, 20 Feb 2017 11:19:05 +0000 (+0100) Subject: CsvImport: Controller erzeugt temporäres Profil, nicht der Hintergrund-Job. X-Git-Tag: release-3.5.4~1222 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=067d87c880d086f3f431e5f4e6599c37d5771905;p=kivitendo-erp.git CsvImport: Controller erzeugt temporäres Profil, nicht der Hintergrund-Job. --- diff --git a/SL/BackgroundJob/CsvImport.pm b/SL/BackgroundJob/CsvImport.pm index 14ad33625..1736721b9 100644 --- a/SL/BackgroundJob/CsvImport.pm +++ b/SL/BackgroundJob/CsvImport.pm @@ -14,13 +14,8 @@ sub create_job { my $package = ref($self_or_class) || $self_or_class; $package =~ s/SL::BackgroundJob:://; - my $profile = delete $params{profile} || SL::DB::CsvImportProfile->new; - my $new_profile = $profile->clone_and_reset_deep; - $new_profile->save; - my %data = ( %params, - profile_id => $new_profile->id, session_id => $::auth->get_session_id, ); diff --git a/SL/Controller/CsvImport.pm b/SL/Controller/CsvImport.pm index 005fcd703..09b970300 100644 --- a/SL/Controller/CsvImport.pm +++ b/SL/Controller/CsvImport.pm @@ -359,9 +359,12 @@ sub test_and_import_deferred { return $self->action_new; } + # save tempory profile + $self->profile($self->profile->clone_and_reset_deep)->save; + $self->{background_job} = SL::BackgroundJob::CsvImport->create_job( file => $self->csv_file_name, - profile => $self->profile, + profile_id => $self->profile->id, type => $self->profile->type, test => $params{test}, employee_id => SL::DB::Manager::Employee->current->id,