From 4a3abd6c5dba18a76dc13ca1e06add2ba1881180 Mon Sep 17 00:00:00 2001 From: Lucas Gass 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 Signed-off-by: Tomas Cohen Arazi --- 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