Bugzilla – Attachment 193991 Details for
Bug 35104
We should warn when attempting to save MARC records that contain characters invalid in XML
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35104: Warn and log when non-XML characters are stripped in bulkmarcimport
0882153.patch (text/plain), 2.14 KB, created by
Martin Renvoize (ashimema)
on 2026-02-26 13:31:58 UTC
(
hide
)
Description:
Bug 35104: Warn and log when non-XML characters are stripped in bulkmarcimport
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2026-02-26 13:31:58 UTC
Size:
2.14 KB
patch
obsolete
>From 0882153fdb3eb6afdd186a5868b17cda56bcc2a8 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Thu, 26 Feb 2026 13:30:55 +0000 >Subject: [PATCH] Bug 35104: Warn and log when non-XML characters are stripped > in bulkmarcimport > >Pass a per-record warnings arrayref through the ModBiblio/AddBiblio options >so that any nonxml_stripped events are captured and reported via print STDERR >and via printlog() to the import log file. >--- > misc/migration_tools/bulkmarcimport.pl | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > >diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl >index 147aa57118c..76505928174 100755 >--- a/misc/migration_tools/bulkmarcimport.pl >+++ b/misc/migration_tools/bulkmarcimport.pl >@@ -562,6 +562,9 @@ RECORD: while () { > } > > # Create biblio, unless we already have it (either match or ISBN) >+ my @import_warnings; >+ $mod_biblio_options->{warnings} = \@import_warnings; >+ $add_biblio_options->{warnings} = \@import_warnings; > if ($matched_record_id) { > eval { $biblioitemnumber = Koha::Biblios->find($matched_record_id)->biblioitem->biblioitemnumber; }; > if ($update) { >@@ -622,6 +625,17 @@ RECORD: while () { > ) if ($logfile); > next RECORD; > } >+ for my $w ( grep { $_->{type} eq 'nonxml_stripped' } @import_warnings ) { >+ warn sprintf( "WARNING: Non-XML characters stripped from biblio %s: %s\n", >+ $record_id // $originalid, $w->{message} ); >+ printlog( >+ { >+ id => $record_id // $originalid, >+ op => "import", >+ status => "warning : non-XML characters stripped" >+ } >+ ) if ($logfile); >+ } > my $record_has_added_items = 0; > if ($record_id) { > $yamlhash->{$originalid} = $record_id if $yamlfile; >-- >2.53.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35104
:
157625
|
157627
|
157628
|
157642
|
159615
|
159620
|
159621
|
159630
|
159810
|
159811
|
159812
|
159813
|
166431
|
173145
|
173146
|
176820
|
176821
|
176850
|
176851
|
176852
|
176860
|
193985
|
193986
|
193987
|
193988
|
193989
|
193990
|
193991
|
193992
|
193993
|
193994
|
193995
|
193996
|
193997
|
193998
|
193999
|
194000
|
194001
|
194004
|
194005
|
194006
|
194007
|
194008
|
194009
|
194010
|
194011
|
194012
|
194013