Bugzilla – Attachment 90905 Details for
Bug 22944
avoid AnonymousPatron in search_patrons_to_anonymise
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22944: avoid AnonymousPatron in search_patrons_to_anonymise
Bug-22944-avoid-AnonymousPatron-in-searchpatronsto.patch (text/plain), 1.83 KB, created by
Nick Clemens (kidclamp)
on 2019-06-21 12:13:30 UTC
(
hide
)
Description:
Bug 22944: avoid AnonymousPatron in search_patrons_to_anonymise
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-06-21 12:13:30 UTC
Size:
1.83 KB
patch
obsolete
>From 2fb18fe081430cbcaa01296abfed04229cbba47a Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Tue, 21 May 2019 11:55:40 +0200 >Subject: [PATCH] Bug 22944: avoid AnonymousPatron in > search_patrons_to_anonymise > >In Koha::Patrons::search_patrons_to_anonymise() old issues already affected to the anonymous patron should be avoided. It is useless and can impact performance. > >It is already working if AnymousPatron is not defined or 0 because of : > 'old_issues.borrowernumber' => { 'not' => undef } > >In theory the anymous patron should have privacy=0 but in case its not it should be explicitly avoided. > >Test plan : >Run t/db_dependent/Koha/Patrons.t > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/Patrons.pm | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/Koha/Patrons.pm b/Koha/Patrons.pm >index 7510093185..c113c2c465 100644 >--- a/Koha/Patrons.pm >+++ b/Koha/Patrons.pm >@@ -154,6 +154,7 @@ sub search_patrons_to_anonymise { > ( C4::Context->preference('IndependentBranches') && C4::Context->userenv && !C4::Context->IsSuperLibrarian() && C4::Context->userenv->{branch} ) > ? C4::Context->userenv->{branch} > : undef; >+ my $anonymous_patron = C4::Context->preference('AnonymousPatron') || undef; > > my $dtf = Koha::Database->new->schema->storage->datetime_parser; > my $rs = $class->_resultset->search( >@@ -161,6 +162,7 @@ sub search_patrons_to_anonymise { > 'old_issues.borrowernumber' => { 'not' => undef }, > privacy => { '<>' => 0 }, # Keep forever > ( $library ? ( 'old_issues.branchcode' => $library ) : () ), >+ ( $anonymous_patron ? ( 'old_issues.borrowernumber' => { '!=' => $anonymous_patron } ) : () ), > }, > { join => ["old_issues"], > distinct => 1, >-- >2.11.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 22944
:
89932
|
89933
|
90488
|
90628
|
90904
| 90905 |
90906