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

(-)a/C4/Biblio.pm (+4 lines)
Lines 21-26 package C4::Biblio; Link Here
21
21
22
use strict;
22
use strict;
23
use warnings;
23
use warnings;
24
use Carp;
24
25
25
# use utf8;
26
# use utf8;
26
use MARC::Record;
27
use MARC::Record;
Lines 294-299 and biblionumber data for indexing. Link Here
294
295
295
sub ModBiblio {
296
sub ModBiblio {
296
    my ( $record, $biblionumber, $frameworkcode ) = @_;
297
    my ( $record, $biblionumber, $frameworkcode ) = @_;
298
    croak "No record" unless $record;
299
297
    if ( C4::Context->preference("CataloguingLog") ) {
300
    if ( C4::Context->preference("CataloguingLog") ) {
298
        my $newrecord = GetMarcBiblio($biblionumber);
301
        my $newrecord = GetMarcBiblio($biblionumber);
299
        logaction( "CATALOGUING", "MODIFY", $biblionumber, "BEFORE=>" . $newrecord->as_formatted );
302
        logaction( "CATALOGUING", "MODIFY", $biblionumber, "BEFORE=>" . $newrecord->as_formatted );
Lines 2665-2670 per the bib's MARC framework. Link Here
2665
2668
2666
sub EmbedItemsInMarcBiblio {
2669
sub EmbedItemsInMarcBiblio {
2667
    my ($marc, $biblionumber) = @_;
2670
    my ($marc, $biblionumber) = @_;
2671
    croak "No MARC record" unless $marc;
2668
2672
2669
    my $frameworkcode = GetFrameworkCode($biblionumber);
2673
    my $frameworkcode = GetFrameworkCode($biblionumber);
2670
    _strip_item_fields($marc, $frameworkcode);
2674
    _strip_item_fields($marc, $frameworkcode);
(-)a/misc/migration_tools/rebuild_zebra.pl (-9 / +17 lines)
Lines 351-358 sub export_marc_records_from_sth { Link Here
351
            # strung together with no single root element.  zebraidx doesn't seem
351
            # strung together with no single root element.  zebraidx doesn't seem
352
            # to care, though, at least if you're using the GRS-1 filter.  It does
352
            # to care, though, at least if you're using the GRS-1 filter.  It does
353
            # care if you're using the DOM filter, which requires valid XML file(s).
353
            # care if you're using the DOM filter, which requires valid XML file(s).
354
            print OUT ($as_xml) ? $marc->as_xml_record(C4::Context->preference('marcflavour')) : $marc->as_usmarc();
354
            eval {
355
            $num_exported++;
355
                print OUT ($as_xml) ? $marc->as_xml_record(C4::Context->preference('marcflavour')) : $marc->as_usmarc();
356
                $num_exported++;
357
            };
358
            if ($@) {
359
              warn "Error exporting record $record_number ($record_type) ".($noxml ? "not XML" : "XML");
360
            }
356
        }
361
        }
357
    }
362
    }
358
    print "\nRecords exported: $num_exported\n" if ( $verbose_logging );
363
    print "\nRecords exported: $num_exported\n" if ( $verbose_logging );
Lines 449-463 sub get_raw_marc_record { Link Here
449
            $fetch_sth->execute($record_number);
454
            $fetch_sth->execute($record_number);
450
            if (my ($blob) = $fetch_sth->fetchrow_array) {
455
            if (my ($blob) = $fetch_sth->fetchrow_array) {
451
                $marc = MARC::Record->new_from_usmarc($blob);
456
                $marc = MARC::Record->new_from_usmarc($blob);
452
                $fetch_sth->finish();
457
                unless ($marc) {
453
            } else {
458
                    warn "error creating MARC::Record from $blob";
454
                return; # failure to find a bib is not a problem -
459
                }
455
                        # a delete could have been done before
456
                        # trying to process a record update
457
            }
460
            }
461
            # failure to find a bib is not a problem -
462
            # a delete could have been done before
463
            # trying to process a record update
464
465
            $fetch_sth->finish();
466
            return unless $marc;
458
        } else {
467
        } else {
459
            eval { $marc = GetMarcBiblio($record_number); };
468
            eval { $marc = GetMarcBiblio($record_number); };
460
            if ($@) {
469
            if ($@ || !$marc) {
461
                # here we do warn since catching an exception
470
                # here we do warn since catching an exception
462
                # means that the bib was found but failed
471
                # means that the bib was found but failed
463
                # to be parsed
472
                # to be parsed
464
- 

Return to bug 6433