X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/d4925a8b60f04674885e30d9316dc0263f8b9a84..b293ff8ad52fc76ba0c44783e3982418114d6b08:/SL/Controller/CsvImport/Base.pm diff --git a/SL/Controller/CsvImport/Base.pm b/SL/Controller/CsvImport/Base.pm index fe8af336a..1aaec79c9 100644 --- a/SL/Controller/CsvImport/Base.pm +++ b/SL/Controller/CsvImport/Base.pm @@ -293,6 +293,7 @@ sub handle_cvars { my %type_to_column = ( text => 'text_value', textfield => 'text_value', + htmlfield => 'text_value', select => 'text_value', date => 'timestamp_value_as_date', timestamp => 'timestamp_value_as_date', @@ -539,9 +540,11 @@ sub save_objects { SL::DB->client->with_transaction(sub { foreach my $entry_index ($chunk_size * $chunk .. min( $last_index, $chunk_size * ($chunk + 1) - 1 )) { my $entry = $data->[$entry_index]; - next if @{ $entry->{errors} }; my $object = $entry->{object_to_save} || $entry->{object}; + $self->save_additions_always($object); + + next if @{ $entry->{errors} }; my $ret; if (!eval { $ret = $object->save(cascade => !!$self->save_with_cascade()); 1 }) { @@ -602,6 +605,18 @@ sub save_additions { return; } +sub save_additions_always { + my ($self, $object) = @_; + + # Can be overridden by derived specialized importer classes to save + # additional tables always. + # This sub is called before the object is saved. Therefore this + # hook will always be executed whether or not the import entry can be saved successfully. + + return; +} + + sub _save_history { my ($self, $object) = @_;