Bug 33229: Clear patron reading history when privacy is set to never
authorNick Clemens <nick@bywatersolutions.com>
Tue, 14 Mar 2023 20:02:10 +0000 (20:02 +0000)
committerMatt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Tue, 18 Apr 2023 12:27:51 +0000 (12:27 +0000)
commitcf14f6f84497e46e9b880dbbe26075ba3673b4e4
tree4c0731827b9ce06a3b6dccb2da093da397efd36b
parentd4fb68703098f25bd587a8fdfc6cd5b4d884c4f9
Bug 33229: Clear patron reading history when privacy is set to never

This patch adds a check to patron store routine. When privacy is changed
to 'Never' we should immediately clear their history

To test:
1 - Set system preferences:
   AnonymousPatron - to a valid borrowernumber
   OPACPrivacy - Allow
2 - Checkout some items to a patron with priacy set to default, return them
3 - Log in to opac as patron
4 - Confirm you can see your history
5 - Change history to Never
6 - Confirm history still viewable
7 - Apply patch, restart all
8 - Set privacy to Default
9 - Confirm you can still see history, not deleted when not set as Never
10 - Set privacy to 'Never'
11 - Confirm history is anonymized

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7c45fc8bdfefb27a1d6f214c2906190bca1d628a)
Koha/Exceptions/Patron.pm
Koha/Patron.pm
t/db_dependent/Koha/Patron.t