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

(-)a/C4/Biblio.pm (-4 / +21 lines)
Lines 93-99 use C4::Charset qw( Link Here
93
    nsb_clean
93
    nsb_clean
94
    SetMarcUnicodeFlag
94
    SetMarcUnicodeFlag
95
    SetUTF8Flag
95
    SetUTF8Flag
96
    StripNonXmlChars
97
);
96
);
98
use C4::Languages;
97
use C4::Languages;
99
use C4::Linker;
98
use C4::Linker;
Lines 107-112 use Koha::Authority::Types; Link Here
107
use Koha::Acquisition::Currencies;
106
use Koha::Acquisition::Currencies;
108
use Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue;
107
use Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue;
109
use Koha::Biblio::Metadatas;
108
use Koha::Biblio::Metadatas;
109
use Koha::Exceptions::Metadata;
110
use Koha::Holds;
110
use Koha::Holds;
111
use Koha::ItemTypes;
111
use Koha::ItemTypes;
112
use Koha::MarcOverlayRules;
112
use Koha::MarcOverlayRules;
Lines 2248-2254 sub TransformHtmlToMarc { Link Here
2248
                    ;
2248
                    ;
2249
                    # between 001 and 009 (included)
2249
                    # between 001 and 009 (included)
2250
                } elsif ( $fval ne '' ) {
2250
                } elsif ( $fval ne '' ) {
2251
                    $fval     = StripNonXmlChars($fval);    #Strip out any non-XML characters like control characters
2252
                    $newfield = MARC::Field->new( $tag, $fval, );
2251
                    $newfield = MARC::Field->new( $tag, $fval, );
2253
                }
2252
                }
2254
2253
Lines 2270-2276 sub TransformHtmlToMarc { Link Here
2270
                        $newfield->add_subfields( $fkey => $fval);
2269
                        $newfield->add_subfields( $fkey => $fval);
2271
                    }
2270
                    }
2272
                    elsif($fval ne '') {
2271
                    elsif($fval ne '') {
2273
                        $fval     = StripNonXmlChars($fval);   #Strip out any non-XML characters like control characters
2274
                        $newfield = MARC::Field->new( $tag, $ind1, $ind2, $fkey => $fval );
2272
                        $newfield = MARC::Field->new( $tag, $ind1, $ind2, $fkey => $fval );
2275
                    }
2273
                    }
2276
                    $j += 2;
2274
                    $j += 2;
Lines 2867-2872 sub ModBiblioMarc { Link Here
2867
        Koha::Util::MARC::set_marc_field($record, C4::Context->preference('MarcFieldForModifierName'), $borrowername);
2865
        Koha::Util::MARC::set_marc_field($record, C4::Context->preference('MarcFieldForModifierName'), $borrowername);
2868
    }
2866
    }
2869
2867
2868
    # Check marcxml roundtrip
2869
    my $marcxml = eval {
2870
        MARC::Record::new_from_xml(
2871
            $record->as_xml_record($encoding), 'UTF-8',
2872
            C4::Context->preference('marcflavour')
2873
        );
2874
    };
2875
    my $marcxml_error = $@;
2876
    chomp $marcxml_error;
2877
    unless ($marcxml) {
2878
        warn $marcxml_error;
2879
        Koha::Exceptions::Metadata::Invalid->throw(
2880
            id             => $m_rs->id,
2881
            biblionumber   => $m_rs->biblionumber,
2882
            format         => 'marcxml',
2883
            schema         => C4::Context->preference('marcflavour'),
2884
            decoding_error => $marcxml_error,
2885
        );
2886
    }
2887
2870
    $m_rs->metadata( $record->as_xml_record($encoding) );
2888
    $m_rs->metadata( $record->as_xml_record($encoding) );
2871
    $m_rs->store;
2889
    $m_rs->store;
2872
2890
2873
- 

Return to bug 35104