Bug 40641

Summary: Patron.pm can create warnings
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: Architecture, internals, and plumbingAssignee: Lucas Gass (lukeg) <lucas>
Status: Pushed to main --- QA Contact: Tomás Cohen Arazi (tcohen) <tomascohen>
Severity: normal    
Priority: P5 - low CC: tomascohen
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
25.11.00
Circulation function:
Bug Depends on: 22632    
Bug Blocks:    
Attachments: Bug 40641: Fallback to empty values when logging action
Bug 40641: Fallback to empty values when logging action
Bug 40641: Fallback to empty values when logging action

Description Lucas Gass (lukeg) 2025-08-12 21:52:10 UTC
Use of uninitialized value in concatenation (.) or string at /kohadevbox/koha/Koha/Patron.pm line 797.


Because of this t/db_dependent/Patron/Borrower_Debarments.t fails
Comment 1 Lucas Gass (lukeg) 2025-08-12 21:53:34 UTC
Created attachment 185356 [details] [review]
Bug 40641: Fallback to empty values when logging action
Comment 2 Lucas Gass (lukeg) 2025-08-13 14:27:18 UTC
This is due to Bug 22632.
Comment 3 Lucas Gass (lukeg) 2025-08-13 14:29:09 UTC
Created attachment 185372 [details] [review]
Bug 40641: Fallback to empty values when logging action

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 4 Lucas Gass (lukeg) 2025-08-13 14:29:49 UTC
Trivial patch and the obvious cause of the regression, self sign-off.
Comment 5 Tomás Cohen Arazi (tcohen) 2025-08-13 14:31:04 UTC
Created attachment 185373 [details] [review]
Bug 40641: Fallback to empty values when logging action

Bug 22632 introduced the merge logging feature but missed to sanitize strings to avoid warnings.
This patch fixes that.

To test:
1. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Patron/Borrower_Debarments.t
=> FAIL: Tests fail! Warnings introduced!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Sign off :-D

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 6 Lucas Gass (lukeg) 2025-08-13 15:19:26 UTC
Pushed to main for 25.11.x, thanks all.