Bug 22944: avoid AnonymousPatron in search_patrons_to_anonymise
authorFridolin Somers <fridolin.somers@biblibre.com>
Tue, 21 May 2019 09:55:40 +0000 (11:55 +0200)
committerFridolin Somers <fridolin.somers@biblibre.com>
Tue, 16 Jul 2019 06:43:37 +0000 (08:43 +0200)
commitcfacdd567378b8aa3c55b506ce483748409e6ff6
tree02e0a13ed2c8c8304823b7fd03ea65cb0c275443
parente11d3de73169e2fbe9e7434894310cfcec625729
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>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 66975364b672ea5f362d49f6e5fca8c9a0e8326c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/Patrons.pm