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.

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This commit is contained in:
Martin Renvoize 2026-03-10 09:39:18 +00:00
parent 55689d41ba
commit 543ebdc2ff
No known key found for this signature in database
GPG Key ID: 2D86E0EAEC83711B
1 changed files with 5 additions and 1 deletions

View File

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