X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FCsvImport%2FBase.pm;h=4f718f72903d8db0c236c70c922b085c048e982c;hb=0929128e47bfa00d012594b35065dc47069f3609;hp=fe8af336ab047a01d420181eabf9d3f67a52e891;hpb=0b68d45da337a155d69fe2417a3c27a1689c5642;p=kivitendo-erp.git diff --git a/SL/Controller/CsvImport/Base.pm b/SL/Controller/CsvImport/Base.pm index fe8af336a..4f718f729 100644 --- a/SL/Controller/CsvImport/Base.pm +++ b/SL/Controller/CsvImport/Base.pm @@ -539,9 +539,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 +604,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 wether or not the import entry can be saved successfully. + + return; +} + + sub _save_history { my ($self, $object) = @_;