From 80486200dea8a53034e2881706b462c1d51b9a84 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 10 Mar 2026 09:39:18 +0000 Subject: [PATCH] Bug 40136: (follow-up) Strip undef and empty fields from patron log data Exclude fields with undef or empty string values from _unblessed_for_log so that CREATE and DELETE log diffs only show fields with meaningful values. --- Koha/Patron.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 9ab86dc27a2..7ad14075760 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -3665,7 +3665,11 @@ sub _unblessed_for_log { my $data = $self->unblessed; delete @{$data}{qw(password lastseen updated_on)}; for my $key ( keys %$data ) { - $data->{$key} = "$data->{$key}" if blessed( $data->{$key} ); + if ( defined $data->{$key} && $data->{$key} ne '' ) { + $data->{$key} = "$data->{$key}" if blessed( $data->{$key} ); + } else { + delete $data->{$key}; + } } return $data; } -- 2.53.0