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.
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 ...