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>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8d2f2f25bf)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Lucas Gass 2025-08-12 21:53:08 +00:00 committed by Paul Derscheid
parent 3b724c5edb
commit 6c1530fc58
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
1 changed files with 6 additions and 6 deletions

View File

@ -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 );
}
}