Bug 40744

Summary: Don't give noisy warning when PatronSelfRegistration is turned off
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: Command-line UtilitiesAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: robin
Version: 24.11   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Katrin Fischer 2025-09-03 07:22:13 UTC
We have several instances on one server. Some are using patron self registration, others do not. Now when cleanup_database.pl is run, we get a warning in the logs:

Self-registrations cannot be removed, system preference PatronSelfRegistrationDefaultCategory is not set 

This is unnecessary, as for the libraries in question PatronSelfRegistration is OFF and PatronSelfRegistrationExpireTemporaryAccountsDelay is set to 0.

The pref description says:
NOTE: This system preference requires the misc/cronjobs/cleanup_database.pl cronjob. Ask your system administrator to schedule it.
No patrons will be deleted if you set the pref to zero or make it empty. 

So we are telling the script, it's OK, we don't want any deleted, and still get the noisy warning. This is unnecessary. 

The warning should only be given when PatronSelfRegistrationExpireTemporaryAccountsDelay is not empty or 0 and the PatronSelfRegistrationDefaultCategory  is empty at the same time. We might also want to check for PatronSelfRegistration.