Bugzilla – Attachment 185373 Details for
Bug 40641
Patron.pm can create warnings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40641: Fallback to empty values when logging action
Bug-40641-Fallback-to-empty-values-when-logging-ac.patch (text/plain), 1.83 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-08-13 14:31:04 UTC
(
hide
)
Description:
Bug 40641: Fallback to empty values when logging action
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-08-13 14:31:04 UTC
Size:
1.83 KB
patch
obsolete
>From 4a3abd6c5dba18a76dc13ca1e06add2ba1881180 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 12 Aug 2025 21:53:08 +0000 >Subject: [PATCH] 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> >--- > Koha/Patron.pm | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 3889d9be1a0..ba02f1c08e0 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -795,13 +795,13 @@ sub merge_with { > > if ( C4::Context->preference("BorrowersLog") ) { > my $info = >- $patron->firstname . " " >- . $patron->surname . " (" >- . $patron->cardnumber . ")" >+ ( $patron->firstname // "" ) . " " >+ . ( $patron->surname // "" ) . " (" >+ . ( $patron->cardnumber // "" ) . ")" > . " has been merged into " >- . $self->firstname . " " >- . $self->surname . " (" >- . $self->cardnumber . ")"; >+ . ( $self->firstname // "" ) . " " >+ . ( $self->surname // "" ) . " (" >+ . ( $self->cardnumber // "" ) . ")"; > logaction( "MEMBERS", "PATRON_MERGE", $self->id, $info ); > } > } >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40641
:
185356
|
185372
| 185373