From 2c6629d0339011225938f10865fb6ba540f50824 Mon Sep 17 00:00:00 2001
From: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Date: Thu, 31 Oct 2019 10:45:41 +0000
Subject: [PATCH] Bug 23916: Anonymise 'issuer' when required

This patch adds the anonymisation of 'old_issues.issuer' alongside the
existing anonymisation of 'old_issues.borrowernumber'

Signed-off-by: Ben Veasey <B.T.Veasey@lboro.ac.uk>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
---
 Koha/Patrons.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Koha/Patrons.pm b/Koha/Patrons.pm
index 3b3b4b1cb6..b826c44101 100644
--- a/Koha/Patrons.pm
+++ b/Koha/Patrons.pm
@@ -195,7 +195,10 @@ sub anonymise_issue_history {
         }
         );
         my $anonymous_patron = C4::Context->preference('AnonymousPatron') || undef;
-        $nb_rows += $old_issues_to_anonymise->update( { 'old_issues.borrowernumber' => $anonymous_patron } );
+        $nb_rows += $old_issues_to_anonymise->update( {
+            'old_issues.borrowernumber' => $anonymous_patron,
+            'old_issues.issuer'         => $anonymous_patron
+        } );
     }
     return $nb_rows;
 }
-- 
2.20.1