@@ -, +, @@ previous behaviour of the script --- misc/migration_tools/bulkmarcimport.pl | 7 +++++++ 1 file changed, 7 insertions(+) --- a/misc/migration_tools/bulkmarcimport.pl +++ a/misc/migration_tools/bulkmarcimport.pl @@ -551,7 +551,14 @@ RECORD: foreach my $record (@{$marc_records}) { } } elsif ($insert) { + my $record_clone = $record->clone(); + C4::Biblio::_strip_item_fields($record_clone); eval { ($record_id, $biblioitemnumber) = AddBiblio($record, $framework) }; + # If incoming record has bib ids set we need to transfer + # new ids from record_clone to incoming record to avoid + # working on wrong record (the original record) later on + # when adding items for example + C4::Biblio::_koha_marc_update_bib_ids($record, $framework, $biblionumber, $biblioitemnumber); if ($@) { warn "ERROR: Insert biblio $originalid failed: $@\n"; printlog( { id => $originalid, op => "insert", status => "ERROR" } ) if ($logfile); --