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

(-)a/C4/Biblio.pm (-2 / +2 lines)
Lines 374-384 sub ModBiblio { Link Here
374
        my $record;
374
        my $record;
375
        my $decoding_error = "";
375
        my $decoding_error = "";
376
        eval { $record = $biblio->metadata->record };
376
        eval { $record = $biblio->metadata->record };
377
        if( $@ ){
377
        if ($@) {
378
            my $exception = $@;
378
            my $exception = $@;
379
            $exception->rethrow unless ( $exception->isa('Koha::Exceptions::Metadata::Invalid') );
379
            $exception->rethrow unless ( $exception->isa('Koha::Exceptions::Metadata::Invalid') );
380
            $decoding_error = "There was an error with this bibliographic record: " . $exception;
380
            $decoding_error = "There was an error with this bibliographic record: " . $exception;
381
            $record = $biblio->metadata->record_strip_nonxml;
381
            $record         = $biblio->metadata->record_strip_nonxml;
382
        }
382
        }
383
        logaction( "CATALOGUING", "MODIFY", $biblionumber, "biblio $decoding_error BEFORE=>" . $record->as_formatted );
383
        logaction( "CATALOGUING", "MODIFY", $biblionumber, "biblio $decoding_error BEFORE=>" . $record->as_formatted );
384
    }
384
    }
(-)a/cataloguing/addbiblio.pl (-1 / +1 lines)
Lines 578-584 my ( Link Here
578
578
579
if ( $biblio && !$breedingid ) {
579
if ( $biblio && !$breedingid ) {
580
    eval { $record = $biblio->metadata->record };
580
    eval { $record = $biblio->metadata->record };
581
    if( $@ ){
581
    if ($@) {
582
        my $exception = $@;
582
        my $exception = $@;
583
        $exception->rethrow unless ( $exception->isa('Koha::Exceptions::Metadata::Invalid') );
583
        $exception->rethrow unless ( $exception->isa('Koha::Exceptions::Metadata::Invalid') );
584
        $record = $biblio->metadata->record_strip_nonxml;
584
        $record = $biblio->metadata->record_strip_nonxml;
(-)a/svc/bib (-7 / +6 lines)
Lines 70-87 sub fetch_bib { Link Here
70
    my $record;
70
    my $record;
71
    my $exception;
71
    my $exception;
72
    my $invalid_metadata;
72
    my $invalid_metadata;
73
    eval { $record = $biblio->metadata->record({ embed_items => scalar $query->param('items') }) };
73
    eval { $record = $biblio->metadata->record( { embed_items => scalar $query->param('items') } ) };
74
    if( $@ ){
74
    if ($@) {
75
        $exception = $@;
75
        $exception = $@;
76
        $exception->rethrow unless ( $exception->isa('Koha::Exceptions::Metadata::Invalid') );
76
        $exception->rethrow unless ( $exception->isa('Koha::Exceptions::Metadata::Invalid') );
77
        $record = $biblio->metadata->record_strip_nonxml({ embed_items => scalar $query->param('items') });
77
        $record           = $biblio->metadata->record_strip_nonxml( { embed_items => scalar $query->param('items') } );
78
        $invalid_metadata = 1;
78
        $invalid_metadata = 1;
79
    }
79
    }
80
    if  (defined $record) {
80
    if ( defined $record ) {
81
        print $query->header(-type => 'text/xml',-charset => 'utf-8', -invalid_metadata => $invalid_metadata );
81
        print $query->header( -type => 'text/xml', -charset => 'utf-8', -invalid_metadata => $invalid_metadata );
82
        print $record->as_xml_record();
82
        print $record->as_xml_record();
83
    } else {
83
    } else {
84
        print $query->header(-type => 'text/xml', -status => '404 Not Found');
84
        print $query->header( -type => 'text/xml', -status => '404 Not Found' );
85
    }
85
    }
86
}
86
}
87
87
88
- 

Return to bug 34014