| Summary: | SIP Patron->new() generates ORM warnings with undefined/empty patron_id | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
| Component: | SIP2 | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
| Status: | Needs Signoff --- | QA Contact: | Testopia <testopia> |
| Severity: | enhancement | ||
| Priority: | P5 - low | CC: | david, dcook, jesse, kyle, lisette, tomascohen |
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40910 | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | Small patch |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: | ||
| Circulation function: | |||
| Attachments: |
Bug 40911: Regression tests
Bug 40911: Fix SIP Patron->new() warnings with undefined/empty patron_id |
||
|
Description
Tomás Cohen Arazi (tcohen)
2025-09-30 14:32:22 UTC
Created attachment 187109 [details] [review] Bug 40911: Regression tests Created attachment 187110 [details] [review] Bug 40911: Fix SIP Patron->new() warnings with undefined/empty patron_id This patch prevents warnings when C4::SIP::ILS::Patron->new() receives undefined, empty, or whitespace-only patron_id values that could occur from faulty plugins or malformed SIP requests. Changes: - Add early validation for undefined/empty patron_id before processing - Add validation for hashref keys to ensure they contain valid values - Add better debug logging for empty hashref scenarios - Prevent potential siplog formatting issues with hashref patron_id - No functional changes - behavior preserved for valid patron identifiers Test plan: 1. Apply the regression tests 2. Run: $ ktd --shell k$ prove t/db_dependent/SIP/Patron.t => FAIL: Tests fail! Warning validation expects no warnings but warnings occur 3. Apply this patch 4. Repeat step 2 => SUCCESS: Tests pass! No warnings generated for invalid input 5. Verify no warnings in SIP logs for malformed requests 6. Sign off :-D I don't get any test failures with just the regression patch: prove t/db_dependent/SIP/Patron.t t/db_dependent/SIP/Patron.t .. ok All tests successful. Files=1, Tests=10, 14 wallclock secs ( 0.02 usr 0.00 sys + 9.00 cusr 4.29 csys = 13.31 CPU) Result: PASS |