View | Details | Raw Unified | Return to bug 25539
Collapse All | Expand All

(-)a/misc/migration_tools/bulkmarcimport.pl (-2 / +8 lines)
Lines 546-552 RECORD: foreach my $record (@{$marc_records}) { Link Here
546
                }
546
                }
547
            }
547
            }
548
            elsif ($insert) {
548
            elsif ($insert) {
549
                eval { ($record_id, $biblioitemnumber) = AddBiblio($record, $framework, $add_biblio_options) };
549
                my $record_clone = $record->clone();
550
                C4::Biblio::_strip_item_fields($record_clone);
551
                eval { ($record_id, $biblioitemnumber) = AddBiblio($record_clone, $framework, $add_biblio_options) };
550
                if ($@) {
552
                if ($@) {
551
                    warn "ERROR: Insert biblio $originalid failed: $@\n";
553
                    warn "ERROR: Insert biblio $originalid failed: $@\n";
552
                    printlog( { id => $originalid, op => "insert", status => "ERROR" } ) if ($logfile);
554
                    printlog( { id => $originalid, op => "insert", status => "ERROR" } ) if ($logfile);
Lines 555-560 RECORD: foreach my $record (@{$marc_records}) { Link Here
555
                else {
557
                else {
556
                    printlog( { id => $originalid, op => "insert", status => "ok" } ) if ($logfile);
558
                    printlog( { id => $originalid, op => "insert", status => "ok" } ) if ($logfile);
557
                }
559
                }
560
                # If incoming record has bib ids set we need to transfer
561
                # new ids from record_clone to incoming record to avoid
562
                # working on wrong record (the original record) later on
563
                # when adding items for example
564
                C4::Biblio::_koha_marc_update_bib_ids($record, $framework, $record_id, $biblioitemnumber);
558
            }
565
            }
559
            else {
566
            else {
560
                warn "WARNING: Insert biblio $originalid skipped";
567
                warn "WARNING: Insert biblio $originalid skipped";
561
- 

Return to bug 25539