From 5a466e14007e46d08c4032e5d237e31aad4c8556 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 27 Feb 2026 14:49:38 +0000 Subject: [PATCH] Bug 35104: Remove silent pre-emptive StripNonXmlChars call from TransformHtmlToMarc The call was only applied to the first subfield of a newly-created MARC field (the elsif branch), not to subsequent subfields added to an existing field, making the stripping incomplete and inconsistent. It was also never imported, causing an "Undefined subroutine" crash on any save via the MARC editor. Non-XML character stripping is now handled entirely by Koha::Biblio::Metadata::store(), which operates on the complete MARC XML, records each stripped character as a biblio_metadata_errors row, and logs a warning - giving cataloguers and administrators full visibility. --- C4/Biblio.pm | 2 -- 1 file changed, 2 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index d59fe9f8333..af06743dbc1 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -88,7 +88,6 @@ use C4::Charset qw( nsb_clean SetMarcUnicodeFlag SetUTF8Flag - StripNonXmlChars ); use C4::Languages; use C4::Linker; @@ -2351,7 +2350,6 @@ sub TransformHtmlToMarc { if ( $fval ne '' && $newfield ) { $newfield->add_subfields( $fkey => $fval ); } elsif ( $fval ne '' ) { - $fval = StripNonXmlChars($fval); #Strip out any non-XML characters like control characters $newfield = MARC::Field->new( $tag, $ind1, $ind2, $fkey => $fval ); } $j += 2; -- 2.53.0