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

(-)a/C4/Biblio.pm (-5 / +1 lines)
Lines 191-199 The C<$options> argument is a hashref with additional parameters: Link Here
191
191
192
=over 4
192
=over 4
193
193
194
=item B<defer_marc_save>
195
Used when ModBiblioMarc is handled by the caller
196
197
=item B<skip_record_index>
194
=item B<skip_record_index>
198
Used when the indexing scheduling will be handled by the caller
195
Used when the indexing scheduling will be handled by the caller
199
196
Lines 212-218 sub AddBiblio { Link Here
212
209
213
    $options //= {};
210
    $options //= {};
214
    my $skip_record_index = $options->{'skip_record_index'} // 0;
211
    my $skip_record_index = $options->{'skip_record_index'} // 0;
215
    my $defer_marc_save   = $options->{defer_marc_save}     // 0;
216
    my $disable_autolink  = $options->{disable_autolink}    // 0;
212
    my $disable_autolink  = $options->{disable_autolink}    // 0;
217
213
218
    if (!$record) {
214
    if (!$record) {
Lines 298-304 sub AddBiblio { Link Here
298
            }
294
            }
299
295
300
            # now add the record, don't index while we are in the transaction though
296
            # now add the record, don't index while we are in the transaction though
301
            ModBiblioMarc( $record, $biblionumber, { skip_record_index => 1 } ) unless $defer_marc_save;
297
            ModBiblioMarc( $record, $biblionumber, { skip_record_index => 1 } );
302
298
303
            # update OAI-PMH sets
299
            # update OAI-PMH sets
304
            if(C4::Context->preference("OAI-PMH:AutoUpdateSets")) {
300
            if(C4::Context->preference("OAI-PMH:AutoUpdateSets")) {
(-)a/misc/migration_tools/bulkmarcimport.pl (-12 lines)
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
- 

Return to bug 25539