Lines 568-580
RECORD: foreach my $record (@{$marc_records}) {
Link Here
|
568 |
my $error_adding = $@; |
568 |
my $error_adding = $@; |
569 |
$record_has_added_items = @{$itemnumbers_ref}; |
569 |
$record_has_added_items = @{$itemnumbers_ref}; |
570 |
|
570 |
|
571 |
# Work on a clone so that if there are real errors, we can maybe |
|
|
572 |
# fix them up later. |
573 |
my $clone_record = $record->clone(); |
574 |
C4::Biblio::_strip_item_fields($clone_record, $framework); |
575 |
# This sets the marc fields if there was an error, and also calls |
576 |
# defer_marc_save. |
577 |
ModBiblioMarc($clone_record, $record_id, $mod_biblio_options); |
578 |
if ($error_adding) { |
571 |
if ($error_adding) { |
579 |
warn "ERROR: Adding items to bib $record_id failed: $error_adding"; |
572 |
warn "ERROR: Adding items to bib $record_id failed: $error_adding"; |
580 |
printlog({ id => $record_id, op => "insert items", status => "ERROR"}) if ($logfile); |
573 |
printlog({ id => $record_id, op => "insert items", status => "ERROR"}) if ($logfile); |
Lines 619-628
RECORD: foreach my $record (@{$marc_records}) {
Link Here
|
619 |
printlog({ id => $record_id, op => "insert items", status => "ERROR" }) if ($logfile); |
612 |
printlog({ id => $record_id, op => "insert items", status => "ERROR" }) if ($logfile); |
620 |
# if we failed because of an exception, assume that |
613 |
# if we failed because of an exception, assume that |
621 |
# the MARC columns in biblioitems were not set. |
614 |
# the MARC columns in biblioitems were not set. |
622 |
|
|
|
623 |
# @FIXME: Why do we save here without stripping items? Besides, |
624 |
# save with stripped items has already been performed |
625 |
ModBiblioMarc($record, $record_id, $mod_biblio_options); |
626 |
next RECORD; |
615 |
next RECORD; |
627 |
} |
616 |
} |
628 |
$record_has_added_items ||= @{$itemnumbers_ref}; |
617 |
$record_has_added_items ||= @{$itemnumbers_ref}; |
629 |
- |
|
|