Bug 37936 - Misleading message about AnonymousPatron in batch anonymization tool
Summary: Misleading message about AnonymousPatron in batch anonymization tool
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-16 21:01 UTC by Caroline Cyr La Rose
Modified: 2024-09-16 21:06 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2024-09-16 21:01:09 UTC
If using the default data (AnonymousPatron = 0), the batch anonymization tool states "The AnonymousPatron system preference is not defined. You can use this feature anyway but NULL will be used to update the checkout history."

However, if you try to anonymize checkout histories, you get an error message saying (among other things) "Exception 'Koha::Exceptions::SysPref::NotSet' thrown 'Required syspref is not set' with syspref => AnonymousPatron"

To recreate:
1. Make sure the AnonymousPatron system preference is set to 0 (the default value)
2. Check out an item to a patron and check it back in
3. Go to Tools > Batch patron deletion and anonymization
   --> In the Batch anonymization section, note that it says that the preference 
       is not set, but we can still use the tool.
4. Check the box Verify you want to anonymize patron checkout history
5. Set the date to tomorrow
6. Click Next
7. Click Finish
   --> Trace error

Either we need to change the message and/or disable the tool if the AnonymousPatron system preference is 0 or empty, or we need to do as the message says and use NULL instead.
Comment 1 David Nind 2024-09-16 21:06:25 UTC
The error is also generated if you have OPACPrivacy set to 'Allow'. 

To replicate:
1. Set OPACPrivacy to 'Allow'
2. In the OPAC go to Your account > Privacy
3. Attempt to set the "Please choose your privacy rule" to 'Never'
4. You get an error:

Exception 'Koha::Exceptions::SysPref::NotSet' thrown 'Required syspref is not set' with syspref => AnonymousPatron
 at /usr/share/perl5/Exception/Class/Base.pm line 88
in Exception::Class::Base::throw at /usr/share/perl5/Exception/Class/Base.pm line
...