Lines 548-554
RECORD: foreach my $record (@{$marc_records}) {
Link Here
|
548 |
} |
548 |
} |
549 |
} |
549 |
} |
550 |
elsif ($insert) { |
550 |
elsif ($insert) { |
551 |
eval { ($record_id, $biblioitemnumber) = AddBiblio($record, $framework, { defer_marc_save => 1 }) }; |
551 |
eval { ($record_id, $biblioitemnumber) = AddBiblio($record, $framework) }; |
552 |
if ($@) { |
552 |
if ($@) { |
553 |
warn "ERROR: Insert biblio $originalid failed: $@\n"; |
553 |
warn "ERROR: Insert biblio $originalid failed: $@\n"; |
554 |
printlog( { id => $originalid, op => "insert", status => "ERROR" } ) if ($logfile); |
554 |
printlog( { id => $originalid, op => "insert", status => "ERROR" } ) if ($logfile); |
Lines 570-582
RECORD: foreach my $record (@{$marc_records}) {
Link Here
|
570 |
$record_has_added_items = @{$itemnumbers_ref}; |
570 |
$record_has_added_items = @{$itemnumbers_ref}; |
571 |
|
571 |
|
572 |
my $error_adding = $@; |
572 |
my $error_adding = $@; |
573 |
# Work on a clone so that if there are real errors, we can maybe |
|
|
574 |
# fix them up later. |
575 |
my $clone_record = $record->clone(); |
576 |
C4::Biblio::_strip_item_fields($clone_record, $framework); |
577 |
# This sets the marc fields if there was an error, and also calls |
578 |
# defer_marc_save. |
579 |
ModBiblioMarc($clone_record, $record_id, $modify_biblio_marc_options); |
580 |
if ($error_adding) { |
573 |
if ($error_adding) { |
581 |
warn "ERROR: Adding items to bib $record_id failed: $error_adding"; |
574 |
warn "ERROR: Adding items to bib $record_id failed: $error_adding"; |
582 |
printlog({ id => $record_id, op => "insert items", status => "ERROR"}) if ($logfile); |
575 |
printlog({ id => $record_id, op => "insert items", status => "ERROR"}) if ($logfile); |
Lines 624-633
RECORD: foreach my $record (@{$marc_records}) {
Link Here
|
624 |
printlog({ id => $record_id, op => "insert items", status => "ERROR" }) if ($logfile); |
617 |
printlog({ id => $record_id, op => "insert items", status => "ERROR" }) if ($logfile); |
625 |
# if we failed because of an exception, assume that |
618 |
# if we failed because of an exception, assume that |
626 |
# the MARC columns in biblioitems were not set. |
619 |
# the MARC columns in biblioitems were not set. |
627 |
|
|
|
628 |
# @FIXME: Why do we save here without stripping items? Besides, |
629 |
# save with stripped items has already been performed |
630 |
ModBiblioMarc($record, $record_id, $modify_biblio_marc_options); |
631 |
next RECORD; |
620 |
next RECORD; |
632 |
} |
621 |
} |
633 |
else { |
622 |
else { |
634 |
- |
|
|