Bugzilla – Attachment 96791 Details for
Bug 23260
Anonymize (remove) patron data from items_last_borrower
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23260: [ALTERNATIVE] Inline code to anonymise_issue_history
Bug-23260-ALTERNATIVE-Inline-code-to-anonymiseissu.patch (text/plain), 2.02 KB, created by
Martin Renvoize (ashimema)
on 2020-01-03 12:38:08 UTC
(
hide
)
Description:
Bug 23260: [ALTERNATIVE] Inline code to anonymise_issue_history
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-01-03 12:38:08 UTC
Size:
2.02 KB
patch
obsolete
>From efbd416aa67c67e4905d4c598ae4e5719d916d94 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 3 Jan 2020 12:35:33 +0000 >Subject: [PATCH] Bug 23260: [ALTERNATIVE] Inline code to > anonymise_issue_history > >This alternative patch reduces the complexity of the change by simply >updateing the existing anonymise_issue_history method to include >anonymisation of the items_last_borrowers table. >--- > Koha/Patrons.pm | 20 ++++++++++++++++++-- > 1 file changed, 18 insertions(+), 2 deletions(-) > >diff --git a/Koha/Patrons.pm b/Koha/Patrons.pm >index f4ca8456a6..f0a9ce4d5a 100644 >--- a/Koha/Patrons.pm >+++ b/Koha/Patrons.pm >@@ -165,9 +165,11 @@ sub search_patrons_to_anonymise { > > Koha::Patrons->search->anonymise_issue_history( { [ before => $older_than_date ] } ); > >-Anonymise issue history (old_issues) for all patrons older than the given date (optional). >+Anonymise issue history (old_issues and items_last_borrowers) for all issues older >+than the given date (optional). >+ > To make sure all the conditions are met, the caller has the responsibility to >-call search_patrons_to_anonymise to filter the Koha::Patrons set >+call search_patrons_to_anonymise to filter the Koha::Patrons set. > > =cut > >@@ -194,8 +196,22 @@ sub anonymise_issue_history { > ) > } > ); >+ >+ my $last_borrowers_to_anonymise = >+ $patron->_resultset->items_last_borrowers->search( >+ { >+ ( >+ $older_than_date >+ ? ( created_on => >+ { '<' => $dtf->format_datetime($older_than_date) } ) >+ : () >+ ) >+ } >+ ); >+ > my $anonymous_patron = C4::Context->preference('AnonymousPatron') || undef; > $nb_rows += $old_issues_to_anonymise->update( { 'old_issues.borrowernumber' => $anonymous_patron } ); >+ $nb_rows += $last_borrowers_to_anonymise->update( { 'items_last_borrowers.borrowernumber' => $anonymous_patron } ); > } > return $nb_rows; > } >-- >2.20.1
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 23260
:
92863
|
92864
|
93052
|
94858
|
94859
|
95033
|
95457
|
95458
|
95459
|
95460
|
95651
|
95698
|
95699
|
95700
|
95701
|
95769
|
95770
|
95771
|
95772
|
96791
|
97841
|
97842
|
98044
|
98053
|
98054
|
98064
|
98282
|
98349
|
98352
|
112734
|
112735
|
112736
|
112737
|
112738
|
112739
|
112740
|
112741
|
112742
|
112743
|
117974
|
117975
|
117976
|
117977
|
117978
|
117979
|
117980
|
117981
|
117982
|
117983
|
120522
|
120523
|
120524
|
120525
|
120526
|
120527
|
120528
|
120529
|
120530
|
120531
|
122963
|
122964
|
122965
|
122966
|
122967
|
122968
|
122969
|
122970
|
122971
|
122972
|
145175
|
145176
|
145177
|
145178
|
145179
|
145180
|
145181
|
145182
|
145183
|
145184
|
157106
|
157107
|
157108
|
157109
|
157110
|
157111
|
157112
|
157113
|
157114
|
157115
|
157116
|
159291
|
159292
|
159293
|
159294
|
159298
|
159299
|
159300
|
159301
|
164129
|
164130
|
164131
|
164132
|
164133