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

(-)a/C4/Biblio.pm (-1 / +9 lines)
Lines 93-98 use C4::Charset qw( Link Here
93
    nsb_clean
93
    nsb_clean
94
    SetMarcUnicodeFlag
94
    SetMarcUnicodeFlag
95
    SetUTF8Flag
95
    SetUTF8Flag
96
    StripNonXmlChars
96
);
97
);
97
use C4::Languages;
98
use C4::Languages;
98
use C4::Linker;
99
use C4::Linker;
Lines 371-377 sub ModBiblio { Link Here
371
372
372
    if ( C4::Context->preference("CataloguingLog") ) {
373
    if ( C4::Context->preference("CataloguingLog") ) {
373
        my $biblio = Koha::Biblios->find($biblionumber);
374
        my $biblio = Koha::Biblios->find($biblionumber);
374
        logaction( "CATALOGUING", "MODIFY", $biblionumber, "biblio BEFORE=>" . $biblio->metadata->record->as_formatted );
375
        my $record;
376
        my $error = "";
377
        eval { $record = $biblio->metadata->record };
378
        if( $@ ){
379
            $record = MARC::Record->new_from_xml( StripNonXmlChars($biblio->metadata->metadata), 'UTF-8',$biblio->metadata->schema );
380
            $error = " | Record had encoding errors: " . $@;
381
        }
382
        logaction( "CATALOGUING", "MODIFY", $biblionumber, "biblio BEFORE=>" . $record->as_formatted . $error ); 
375
    }
383
    }
376
384
377
    if ( !$options->{disable_autolink} && C4::Context->preference('AutoLinkBiblios') ) {
385
    if ( !$options->{disable_autolink} && C4::Context->preference('AutoLinkBiblios') ) {
(-)a/cataloguing/addbiblio.pl (-2 / +6 lines)
Lines 43-49 use C4::Context; Link Here
43
use MARC::Record;
43
use MARC::Record;
44
use C4::ClassSource qw( GetClassSources );
44
use C4::ClassSource qw( GetClassSources );
45
use C4::ImportBatch qw( GetImportRecordMarc );
45
use C4::ImportBatch qw( GetImportRecordMarc );
46
use C4::Charset qw( SetMarcUnicodeFlag );
46
use C4::Charset qw( SetMarcUnicodeFlag StripNonXmlChars );
47
use Koha::BiblioFrameworks;
47
use Koha::BiblioFrameworks;
48
use Koha::DateUtils qw( dt_from_string );
48
use Koha::DateUtils qw( dt_from_string );
49
49
Lines 577-583 my ( Link Here
577
);
577
);
578
578
579
if ( $biblio && !$breedingid ) {
579
if ( $biblio && !$breedingid ) {
580
    $record = $biblio->metadata->record;
580
    eval { $record = $biblio->metadata->record };
581
    if( $@ ){
582
        $template->param( yucky_record => $@ );
583
        $record = MARC::Record->new_from_xml( StripNonXmlChars($biblio->metadata->metadata), 'UTF-8',$biblio->metadata->schema );
584
    }
581
}
585
}
582
if ($breedingid) {
586
if ($breedingid) {
583
    ( $record, $encoding ) = MARCfindbreeding( $breedingid ) ;
587
    ( $record, $encoding ) = MARCfindbreeding( $breedingid ) ;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt (-1 / +6 lines)
Lines 809-814 function PopupMARCFieldDoc(field) { Link Here
809
[% END #/ WRAPPER sub-header.inc %]
809
[% END #/ WRAPPER sub-header.inc %]
810
810
811
    <div class="main container-fluid">
811
    <div class="main container-fluid">
812
    [% IF yucky_record %]
813
        <div class="dialog alert">
814
            <p>This record had encoding issues, non-xml characters have been stripped in order to allow editing. Please be cautious when saving that some data may have been removed from the record.</br>Decoding error:</p>
815
            <span class="problem">[% yucky_record | html %]</span>
816
        </div>
817
    [% END %]
812
        <div class="row">
818
        <div class="row">
813
            <div class="col-md-10 col-md-offset-1">
819
            <div class="col-md-10 col-md-offset-1">
814
820
815
- 

Return to bug 34014