From f2003e3e52d60f9b088a5ad06536a745e1010dcd Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Wed, 19 Aug 2026 13:10:08 +0000 Subject: [PATCH] Bug 35104: (RM follow-up) Restore StripNonXmlChars in TransformHtmlToMarc Removed by 6726b1a2544 on the assumption store() strips centrally - but TransformHtmlToMarc never calls store(), so callers like addbiblio.pl (FindDuplicate, duplicate redisplay) see unstripped control characters again, the same failure Bug 34549 fixed. repair_marcxml covers more faults but works on full MARCXML and can throw - too big a change here; left as a follow-up. Test plan: prove t/db_dependent/Biblio/TransformHtmlToMarc.t Signed-off-by: Pedro Amorim --- C4/Biblio.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index c0d7baa7b9..f694a19f46 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -89,6 +89,7 @@ use C4::Charset qw( nsb_clean SetMarcUnicodeFlag SetUTF8Flag + StripNonXmlChars ); use C4::Languages; use C4::Linker; @@ -2363,6 +2364,7 @@ sub TransformHtmlToMarc { # between 001 and 009 (included) } elsif ( $fval ne '' ) { + $fval = StripNonXmlChars($fval); $newfield = MARC::Field->new( $tag, $fval, ); } @@ -2387,6 +2389,7 @@ sub TransformHtmlToMarc { if ( $fval ne '' && $newfield ) { $newfield->add_subfields( $fkey => $fval ); } elsif ( $fval ne '' ) { + $fval = StripNonXmlChars($fval); $newfield = MARC::Field->new( $tag, $ind1, $ind2, $fkey => $fval ); } $j += 2;