Koha-clms/C4/SIP
Tomás Cohen Arazi 11272b8049
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: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2026-03-18 15:58:06 +13:00
..
ILS Bug 22873: Add comment to explain what disallow_overpayment is for 2023-10-17 17:23:40 +00:00
Sip Bug 40915: Add enhanced debug logging for empty critical fields in SIP message parsing 2026-03-18 15:58:06 +13:00
t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
ILS.pm Bug 34767: Pass fee_ack into ::Transaction::Renew(All) 2023-10-12 15:31:49 +00:00
ILS.pod Bug 13506 [QA Follouwp] - Fix POD 2015-02-20 11:54:41 -03:00
Logger.pm Bug 26673: Remove shebangs from Perl modules 2020-10-26 00:14:42 +01:00
Makefile bug 3435: SIP2 - 3M extension for SmartChute checkin. 2009-07-30 11:06:53 -04:00
README Bug 15253: Rename syslog() to siplog() 2020-05-12 11:46:46 +01:00
SIPServer.pm Bug 29264: SIP config allows use of non-branchcode institution ids causes workers to die without responding 2021-11-15 12:38:39 +01:00
Sip.pm Bug 37816: (QA follow-up) Avoid repetition, typo and pipe test 2025-02-25 16:35:00 -05:00
Trapper.pm Bug 32612: (QA follow-up) Add POD and fix typo 2023-02-08 16:47:27 +00:00

README

README for Open NSIP 3M-SIP Server

DEPENDENCIES

SIPServer is written entirely in Perl, but it require these CPAN
perl modules to run:

     Net::Server - The SIP server is a Net::Server::Prefork server
     XML::LibXML
     XML::Parser
     XML::Simple - for parsing the config file
     UNIVERSAL::require - for loading the correct ILS interface module
     Clone - for running the test cases

LOGGING

SIPServer uses Koha::Logger for status and debugging messages.