Bugzilla – Attachment 195159 Details for
Bug 40136
Record diff in action logs when modifying a patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40136: (follow-up) Log newly-filled fields when editing a patron
19c5082.patch (text/plain), 1.49 KB, created by
Martin Renvoize (ashimema)
on 2026-03-12 09:24:35 UTC
(
hide
)
Description:
Bug 40136: (follow-up) Log newly-filled fields when editing a patron
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2026-03-12 09:24:35 UTC
Size:
1.49 KB
patch
obsolete
>From 19c50828d24084216a29b9a5b89675a2f740ac3b Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Thu, 12 Mar 2026 09:23:14 +0000 >Subject: [PATCH] Bug 40136: (follow-up) Log newly-filled fields when editing a > patron > >Previously, _unblessed_for_log strips undef/empty fields, so fields >that were blank before an edit were absent from $from_storage. Because >@keys was built only from keys %{$from_storage}, any field that >transitioned from empty to a value was never iterated and the change >went unlogged. > >Fix by unioning keys from both old and new state so that added, >changed, and cleared fields are all detected. >--- > Koha/Patron.pm | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index f2ac42f7577..baebed49ef4 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -382,7 +382,8 @@ sub store { > my $from_storage = $self_from_storage->_unblessed_for_log; > my $from_object = $self->_unblessed_for_log; > >- my @keys = C4::Context->preference("BorrowersLog") ? keys %{$from_storage} : ('cardnumber'); >+ my %all_keys = map { $_ => 1 } ( keys %{$from_storage}, keys %{$from_object} ); >+ my @keys = C4::Context->preference("BorrowersLog") ? keys %all_keys : ('cardnumber'); > my $changed; > for my $key (@keys) { > my $storage_value = $from_storage->{$key} // q{}; >-- >2.53.0 >
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 40136
:
194872
|
194940
|
195036
|
195037
|
195046
|
195083
|
195084
|
195085
|
195086
|
195087
|
195126
|
195159
|
195218
|
195219
|
195220
|
195221
|
195222
|
195223
|
195224