Bugzilla – Attachment 180109 Details for
Bug 39322
When pseudonymizing don't fetch patron attributes if none are kept
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39322: Don't fetch borrower attributes if none kept for pseudonymization
Bug-39322-Dont-fetch-borrower-attributes-if-none-k.patch (text/plain), 1.83 KB, created by
David Nind
on 2025-04-01 09:42:37 UTC
(
hide
)
Description:
Bug 39322: Don't fetch borrower attributes if none kept for pseudonymization
Filename:
MIME Type:
Creator:
David Nind
Created:
2025-04-01 09:42:37 UTC
Size:
1.83 KB
patch
obsolete
>From 00bd8cad2d2e1ae06d41b36c1061b1fe875cffee Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 13 Mar 2025 13:09:59 +0000 >Subject: [PATCH] Bug 39322: Don't fetch borrower attributes if none kept for > pseudonymization > >This patch simply checks the count of pseudonymized borrower attributes before >looping through them > >To test: > 1 - Define several borrower attributes, none kept for pseudonymization > 2 - Add some values for those attributes to some patrons > 3 - Generate some statistics for those patrons (checkin, checkout, renew, etc) > 4 - Enable pseudonymization > 5 - On command line: export DBIC_TRACE=1 > 6 - Run the pseudonymization script with a date in the future to ensure all transactions are captured: > perl misc/maintenance/pseudonymize_statistics.pl -v -c --before 2026-01-01 > 7 - Note the borrower attributes are fetched > 8 - Apply patch > 9 - repeat 6 >10 - Note the attributes are only counted, not fetched >11 - Make one of the attributes kept >12 - repeat 6 >13 - Note the attributes are counted and fetched > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/PseudonymizedTransaction.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/PseudonymizedTransaction.pm b/Koha/PseudonymizedTransaction.pm >index ee243d76e6..fca0141c01 100644 >--- a/Koha/PseudonymizedTransaction.pm >+++ b/Koha/PseudonymizedTransaction.pm >@@ -96,7 +96,7 @@ sub new_from_statistic { > > my $self = $class->SUPER::new($values); > >- if ($patron) { >+ if ( $patron && Koha::Patron::Attribute::Types->search( { keep_for_pseudonymization => 1 } )->count > 0 ) { > my $extended_attributes = $patron->extended_attributes->unblessed; > for my $attribute (@$extended_attributes) { > next unless Koha::Patron::Attribute::Types->find( $attribute->{code} )->keep_for_pseudonymization; >-- >2.39.5
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 39322
:
179240
|
180109
|
181858
|
181859
|
181863