Lines 541-547
RECORD: foreach my $record (@{$marc_records}) {
Link Here
|
541 |
} |
541 |
} |
542 |
} |
542 |
} |
543 |
elsif ($insert) { |
543 |
elsif ($insert) { |
544 |
eval { ($record_id, $biblioitemnumber) = AddBiblio($record, $framework, { defer_marc_save => 1 }) }; |
544 |
eval { ($record_id, $biblioitemnumber) = AddBiblio($record, $framework) }; |
545 |
if ($@) { |
545 |
if ($@) { |
546 |
warn "ERROR: Insert biblio $originalid failed: $@\n"; |
546 |
warn "ERROR: Insert biblio $originalid failed: $@\n"; |
547 |
printlog( { id => $originalid, op => "insert", status => "ERROR" } ) if ($logfile); |
547 |
printlog( { id => $originalid, op => "insert", status => "ERROR" } ) if ($logfile); |
Lines 563-575
RECORD: foreach my $record (@{$marc_records}) {
Link Here
|
563 |
$record_has_added_items = @{$itemnumbers_ref}; |
563 |
$record_has_added_items = @{$itemnumbers_ref}; |
564 |
|
564 |
|
565 |
my $error_adding = $@; |
565 |
my $error_adding = $@; |
566 |
# Work on a clone so that if there are real errors, we can maybe |
|
|
567 |
# fix them up later. |
568 |
my $clone_record = $record->clone(); |
569 |
C4::Biblio::_strip_item_fields($clone_record, $framework); |
570 |
# This sets the marc fields if there was an error, and also calls |
571 |
# defer_marc_save. |
572 |
ModBiblioMarc($clone_record, $record_id, $modify_biblio_marc_options); |
573 |
if ($error_adding) { |
566 |
if ($error_adding) { |
574 |
warn "ERROR: Adding items to bib $record_id failed: $error_adding"; |
567 |
warn "ERROR: Adding items to bib $record_id failed: $error_adding"; |
575 |
printlog({ id => $record_id, op => "insert items", status => "ERROR"}) if ($logfile); |
568 |
printlog({ id => $record_id, op => "insert items", status => "ERROR"}) if ($logfile); |
Lines 617-626
RECORD: foreach my $record (@{$marc_records}) {
Link Here
|
617 |
printlog({ id => $record_id, op => "insert items", status => "ERROR" }) if ($logfile); |
610 |
printlog({ id => $record_id, op => "insert items", status => "ERROR" }) if ($logfile); |
618 |
# if we failed because of an exception, assume that |
611 |
# if we failed because of an exception, assume that |
619 |
# the MARC columns in biblioitems were not set. |
612 |
# the MARC columns in biblioitems were not set. |
620 |
|
|
|
621 |
# @FIXME: Why do we save here without stripping items? Besides, |
622 |
# save with stripped items has already been performed |
623 |
ModBiblioMarc($record, $record_id, $modify_biblio_marc_options); |
624 |
next RECORD; |
613 |
next RECORD; |
625 |
} |
614 |
} |
626 |
else { |
615 |
else { |
627 |
- |
|
|