From 26615171934be3220b570e09b91a6708fd5dbb27 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 19 Jun 2018 13:19:15 +0100 Subject: [PATCH] Bug 20964: Restore original filtering behaviour after bug 16966 Bug 16966 altered the filter criteria of the anonymise selection, this patch restores the original behaviour. --- Koha/Patrons.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Koha/Patrons.pm b/Koha/Patrons.pm index 0d2d9ec6b4..cb36d568b2 100644 --- a/Koha/Patrons.pm +++ b/Koha/Patrons.pm @@ -140,7 +140,8 @@ sub guarantor { my $patrons = Koha::Patrons->search_patrons_to_anonymise( { before => $older_than_date, [ library => $library ] } ); -This method returns all patrons who has an issue history older than a given date. +This method returns all patrons who have an issue history older than a given date, and it may optionally be filtered by +patrons home library =cut @@ -159,7 +160,7 @@ sub search_patrons_to_anonymise { { returndate => { '<' => $dtf->format_datetime($older_than_date), }, 'old_issues.borrowernumber' => { 'not' => undef }, privacy => { '<>' => 0 }, # Keep forever - ( $library ? ( 'old_issues.branchcode' => $library ) : () ), + ( $library ? ( branchcode => $library ) : () ), }, { join => ["old_issues"], distinct => 1, -- 2.17.1