[Koha-bugs] [Bug 35104] We should warn when attempting to save MARC records that contain characters invalid in XML

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Dec 15 00:39:56 CET 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35104

--- Comment #36 from David Cook <dcook at prosentient.com.au> ---
(In reply to Jonathan Druart from comment #35)
> IMO this is too low level, we should not call MARC::Record::new_from_xml
> everytime we store.
> 
> It will work ofc but what about perf?

I think that we should validate each time we store. However... maybe we could
use XML::LibXML directly instead of MARC::Record to reduce some overhead. I
don't know if it makes an actual difference in terms of perf though. And the
nice thing about using MARC::Record is we know if it will break on subsequent
usage.

Perhaps more importantly, these patches don't add error handling for every
instance of Koha::Biblio::Metadata->store(). We might be breaking Staged MARC
imports here and not realizing it. 

So maybe we should add a Koha::Biblio::Metadata->validate() and just call it
from the controller script for now? 

> What if I do want invalid marcxml? :D

:P

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list