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

(-)a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/koha-backend.js (-1 / +5 lines)
Lines 106-112 define( [ '/cgi-bin/koha/svc/cataloguing/framework?frameworkcode=&callback=defin Link Here
106
        GetRecord: function( id, remove_control_num, callback ) {
106
        GetRecord: function( id, remove_control_num, callback ) {
107
            $.get(
107
            $.get(
108
                '/cgi-bin/koha/svc/bib/'+ id
108
                '/cgi-bin/koha/svc/bib/'+ id
109
            ).done( function( metadata ) {
109
            ).done( function( metadata, status, xhr ) {
110
                let encoding_issues = xhr.getResponseHeader('invalid-metadata');
111
                if( encoding_issues ){
112
                    humanMsg.displayAlert( _("Record had encoding issues, please see logs") );
113
                }
110
                $.get(
114
                $.get(
111
                    '/cgi-bin/koha/svc/bib_framework/' + id
115
                    '/cgi-bin/koha/svc/bib_framework/' + id
112
                ).done( function( frameworkcode ) {
116
                ).done( function( frameworkcode ) {
(-)a/svc/bib (-3 / +11 lines)
Lines 67-75 sub fetch_bib { Link Here
67
    my $query = shift;
67
    my $query = shift;
68
    my $biblionumber = shift;
68
    my $biblionumber = shift;
69
    my $biblio = Koha::Biblios->find( $biblionumber );
69
    my $biblio = Koha::Biblios->find( $biblionumber );
70
    my $record = $biblio->metadata->record({ embed_items => scalar $query->param('items') });
70
    my $record;
71
    my $exception;
72
    my $invalid_metadata;
73
    eval { $record = $biblio->metadata->record({ embed_items => scalar $query->param('items') }) };
74
    if( $@ ){
75
        $exception = $@;
76
        $exception->rethrow unless ( $exception->isa('Koha::Exceptions::Metadata::Invalid') );
77
        $record = $biblio->metadata->record_strip_nonxml({ embed_items => scalar $query->param('items') });
78
        $invalid_metadata = 1;
79
    }
71
    if  (defined $record) {
80
    if  (defined $record) {
72
        print $query->header(-type => 'text/xml',-charset => 'utf-8',);
81
        print $query->header(-type => 'text/xml',-charset => 'utf-8', -invalid_metadata => $invalid_metadata );
73
        print $record->as_xml_record();
82
        print $record->as_xml_record();
74
    } else {
83
    } else {
75
        print $query->header(-type => 'text/xml', -status => '404 Not Found');
84
        print $query->header(-type => 'text/xml', -status => '404 Not Found');
76
- 

Return to bug 34014