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)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 14 Apr 2023 18:39:41 +0000 (15:39 -0300)
commit7c45fc8bdfefb27a1d6f214c2906190bca1d628a
treeca3bb0c7fcd348e53a037cea496969fc9b4bbe61
parentf46948ad6387c2d960cb39ed8903a654faf57072
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>
Koha/Exceptions/Patron.pm
Koha/Patron.pm
t/db_dependent/Koha/Patron.t