From 768f2a48825a02a5c73bf232b1d8e8ad247fbf3f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 22 Jan 2026 16:13:44 +0100 Subject: [PATCH] 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 Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize (cherry picked from commit d331c7aba8e5ae252f63560b51fe22ae963f15c2) Signed-off-by: Jacob O'Mara Signed-off-by: Wainui Witika-Park --- misc/cronjobs/cleanup_database.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl index 771846adfc..2299e59cc5 100755 --- a/misc/cronjobs/cleanup_database.pl +++ b/misc/cronjobs/cleanup_database.pl @@ -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;