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

--- Comment #2 from Pedro Amorim (ammopt) <[email protected]> ---
Created attachment 207109
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207109&action=edit
Bug 43694: Emit ISO 18626 elements in schema order

Koha::REST::V1::to_xml builds XML from Perl hashes, so child elements
come out in random hash order. ISO 18626 uses xs:sequence, so element
order is significant and schema-conformant partners rejected the
messages, differently on each attempt.

xml_with_envelope now puts every element's children in the order of
ISO-18626-2021-3.xsd before adding the envelope. Elements the schema
does not define come last, sorted by name. Koha::REST::V1::to_xml is
unchanged.

Test plan:
1) Apply patch and restart_all
2) Run this a few times and note the element order is the same every time,
   and matches the schema (header, messageInfo, statusInfo):
   perl -MKoha::ILL::ISO18626 -e 'print
Koha::ILL::ISO18626::xml_with_envelope({ supplyingAgencyMessage => { statusInfo
=> { status => "Loaned" }, messageInfo => { reasonForMessage => "StatusChange"
}, header => { timestamp => "2026-09-30T00:00:00Z", requestingAgencyRequestId
=> 1 } } })'
3) prove t/db_dependent/Koha/ILL/ISO18626.t
t/db_dependent/api/v1/iso18626/request.t

Co-Authored-By: Claude Opus 5.5 <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to