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

(-)a/C4/Biblio.pm (-2 / +2 lines)
Lines 1070-1078 sub GetMarcBiblio { Link Here
1070
        if ($@) { warn " problem with :$biblionumber : $@ \n$marcxml"; }
1070
        if ($@) { warn " problem with :$biblionumber : $@ \n$marcxml"; }
1071
        return unless $record;
1071
        return unless $record;
1072
1072
1073
        C4::Biblio::_koha_marc_update_bib_ids($record, '', $biblionumber, $biblionumber);
1073
	C4::Biblio::EmbedItemsInMarcBiblio($record, $biblionumber) if ($embeditems);
1074
	C4::Biblio::EmbedItemsInMarcBiblio($record, $biblionumber) if ($embeditems);
1074
1075
1075
        #      $record = MARC::Record::new_from_usmarc( $marc) if $marc;
1076
        return $record;
1076
        return $record;
1077
    } else {
1077
    } else {
1078
        return undef;
1078
        return undef;
Lines 2730-2736 sub EmbedItemsInMarcBiblio { Link Here
2730
        my $item_marc = C4::Items::GetMarcItem($biblionumber, $itemnumber);
2730
        my $item_marc = C4::Items::GetMarcItem($biblionumber, $itemnumber);
2731
        push @item_fields, $item_marc->field($itemtag);
2731
        push @item_fields, $item_marc->field($itemtag);
2732
    }
2732
    }
2733
    $marc->insert_fields_ordered(@item_fields);
2733
    $marc->append_fields(@item_fields);
2734
}
2734
}
2735
2735
2736
=head1 INTERNAL FUNCTIONS
2736
=head1 INTERNAL FUNCTIONS
(-)a/misc/migration_tools/rebuild_zebra.pl (-8 / +2 lines)
Lines 433-442 sub get_corrected_marc_record { Link Here
433
433
434
    if (defined $marc) {
434
    if (defined $marc) {
435
        fix_leader($marc);
435
        fix_leader($marc);
436
        if ($record_type eq 'biblio') {
436
        if ($record_type eq 'authority') {
437
            my $succeeded = fix_biblio_ids($marc, $record_number);
438
            return unless $succeeded;
439
        } else {
440
            fix_authority_id($marc, $record_number);
437
            fix_authority_id($marc, $record_number);
441
        }
438
        }
442
        if (C4::Context->preference("marcflavour") eq "UNIMARC") {
439
        if (C4::Context->preference("marcflavour") eq "UNIMARC") {
Lines 468-474 sub get_raw_marc_record { Link Here
468
            $fetch_sth->finish();
465
            $fetch_sth->finish();
469
            return unless $marc;
466
            return unless $marc;
470
        } else {
467
        } else {
471
            eval { $marc = GetMarcBiblio($record_number); };
468
            eval { $marc = GetMarcBiblio($record_number, 1); };
472
            if ($@ || !$marc) {
469
            if ($@ || !$marc) {
473
                # here we do warn since catching an exception
470
                # here we do warn since catching an exception
474
                # means that the bib was found but failed
471
                # means that the bib was found but failed
Lines 477-484 sub get_raw_marc_record { Link Here
477
                return;
474
                return;
478
            }
475
            }
479
        }
476
        }
480
        # ITEM
481
        C4::Biblio::EmbedItemsInMarcBiblio($marc, $record_number);
482
    } else {
477
    } else {
483
        eval { $marc = GetAuthority($record_number); };
478
        eval { $marc = GetAuthority($record_number); };
484
        if ($@) {
479
        if ($@) {
485
- 

Return to bug 6789