Bug 40744: Ignore --del-exp-selfreg if pref is not set

If PatronSelfRegistration we should ignore (i.e. do nothing) if
--del-exp-selfreg is passed to cleanup_database.pl

It prevents the script to warn that the pref is not set.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
(cherry picked from commit d331c7aba8)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
This commit is contained in:
Jonathan Druart 2026-01-22 16:13:44 +01:00 committed by Wainui Witika-Park
parent 8943833fb1
commit 768f2a4882
No known key found for this signature in database
GPG Key ID: 2D0A6AB5DAF1B78D
1 changed files with 1 additions and 1 deletions

View File

@ -524,7 +524,7 @@ if ($verbose) {
say $confirm ? sprintf( "Deleted %d patrons", $count ) : sprintf( "%d patrons would have been deleted", $count );
}
if ($pExpSelfReg) {
if ( $pExpSelfReg && C4::Context->preference('PatronSelfRegistration') ) {
try {
my $opac_registrations = Koha::Patrons->search->filter_by_expired_opac_registrations->filter_by_safe_to_delete;
my $count = $opac_registrations->count;