diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm index 8f5cf00a1c..a200876bb2 100644 --- a/C4/ImportBatch.pm +++ b/C4/ImportBatch.pm @@ -714,15 +714,16 @@ sub BatchCommitRecords { $sth->finish(); + SetImportBatchStatus($batch_id, 'imported'); + + # Moved final commit to the end + $schema->txn_commit; + if ( @biblio_ids ) { my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); $indexer->index_records( \@biblio_ids, "specialUpdate", "biblioserver" ); } - SetImportBatchStatus($batch_id, 'imported'); - - # Moved final commit to the end - $schema->txn_commit; return ($num_added, $num_updated, $num_items_added, $num_items_replaced, $num_items_errored, $num_ignored); }