Koha-clms/C4/SIP/Sip
Tomás Cohen Arazi 70c9fa23b0
Bug 40915: Add enhanced debug logging for empty critical fields in SIP message parsing
This patch adds debug logging to C4::SIP::Sip::MsgType::_initialize() to help
identify when critical fields (patron_id, item_id) are parsed as empty values.

Empty critical fields in SIP messages can later cause DBIx::Class constraint
errors when passed to Koha::Objects->find() operations, generating confusing
'Odd number of elements in anonymous hash' errors in SIP server logs.

The enhanced logging helps administrators identify the root cause by logging
when empty patron_id or item_id fields are detected during message parsing.

To test:
1. Apply regression tests patch first
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/SIP/MsgType.t
=> FAIL: Debug logging tests fail (no enhanced logging present)
3. Apply this patch
4. Run:
   $ ktd --shell
  k$ prove t/db_dependent/SIP/MsgType.t
=> SUCCESS: All tests pass, debug logging works correctly
5. Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 220fdce180)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit c7330715b0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-11-10 14:52:06 +01:00
..
Checksum.pm Bug 28606: Remove $DEBUG and $ENV{DEBUG} 2021-06-24 11:53:44 +02:00
Configuration.pm Bug 36948: (follow-up) Allow IPv[46] in port config 2024-06-11 08:10:01 +01:00
Constants.pm Bug 7904 Change SIP modules to use standard LIB path 2015-02-05 14:44:54 -03:00
MsgType.pm Bug 40915: Add enhanced debug logging for empty critical fields in SIP message parsing 2025-11-10 14:52:06 +01:00