From 08f2fd5a7f69cafccd55d70028249c7bcbd959cd Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Thu, 25 Sep 2025 19:33:34 +0000 Subject: [PATCH] Bug 23260: Update cron to exit if AnonymousPatron is not set --- misc/cronjobs/anonymize_last_borrowers.pl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/misc/cronjobs/anonymize_last_borrowers.pl b/misc/cronjobs/anonymize_last_borrowers.pl index 900639f309e..ce734d58a41 100755 --- a/misc/cronjobs/anonymize_last_borrowers.pl +++ b/misc/cronjobs/anonymize_last_borrowers.pl @@ -56,17 +56,17 @@ if ($help) { usage(0); } -my $pref1 = C4::Context->preference("AnonymizeLastBorrower"); -my $pref2 = C4::Context->preference("AnonymousPatron"); +my $AnonymizeLastBorrower = C4::Context->preference("AnonymizeLastBorrower"); +my $AnonymousPatron = C4::Context->preference("AnonymousPatron"); -if ( !$pref1 ) { - print "Preference 'AnonymizeLastBorrower' must be enabled to anonymize item's last borrower\n\n"; - usage(1); +unless ($AnonymizeLastBorrower) { + print STDERR "Preference 'AnonymizeLastBorrower' must be enabled to anonymize item's last borrower\n\n"; + exit(1); } -if ( !$pref2 ) { - print "Preference 'AnonymousPatron' must be enabled to anonymize item's last borrower\n\n"; - usage(1); +unless ($AnonymousPatron) { + print STDERR "Preference 'AnonymousPatron' must be enabled to anonymize item's last borrower\n\n"; + exit(1); } unless ($confirm) { -- 2.39.5