And the cronjob isn't being called with $verbose If the EnhancedMessagingPreferences system preference is off, the automatic_renewals.pl cronjob will print this daily, even if the script is not run with $verbose /etc/cron.daily/koha-common: The "EnhancedMessagingPreferences" syspref is off. Therefore, it is unlikely that this script will actually produce any messages to be sent. To change this, edit the "EnhancedMessagingPreferences" syspref.
Created attachment 173741 [details] [review] Bug 38306: Only print EnhancedMessagingPreferences warning if run with verbose This enhancement will amend the automatic_renewals.pl script to only print a warning about the EnhancedMessagingPreferences system preference being disabled if the script was run with verbose. To test: 1. Disable EnhancedMessagingPreferences 2. Run misc/cronjobs/automatic_renewals.pl 3. Notice the warning is printed 4. Apply the patch and restart services 5. Run misc/cronjobs/automatic_renewals.pl and notice the warning is not printed 6. Run misc/cronjobs/automatic_renewals.pl --verbose and notice the warning is printed 7. Enable EnhancedMessagingPreferences 8. Run misc/cronjobs/automatic_renewals.pl and notice the warning is not printed Sponsored-by: Catalyst IT
Created attachment 176299 [details] [review] Bug 38306: Only print EnhancedMessagingPreferences warning if run with verbose This enhancement will amend the automatic_renewals.pl script to only print a warning about the EnhancedMessagingPreferences system preference being disabled if the script was run with verbose. To test: 1. Disable EnhancedMessagingPreferences 2. Run misc/cronjobs/automatic_renewals.pl 3. Notice the warning is printed 4. Apply the patch and restart services 5. Run misc/cronjobs/automatic_renewals.pl and notice the warning is not printed 6. Run misc/cronjobs/automatic_renewals.pl --verbose and notice the warning is printed 7. Enable EnhancedMessagingPreferences 8. Run misc/cronjobs/automatic_renewals.pl and notice the warning is not printed Sponsored-by: Catalyst IT Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
What about: my $send_notices_pref = C4::Context->preference('AutoRenewalNotices'); if ( $send_notices_pref eq 'cron' ) { warn <<'END_WARN'; The "AutoRenewalNotices" syspref is set to 'Follow the cron switch'. The send_notices switch for this script is deprecated, you should either set the preference to 'Never send emails' or 'Follow patron messaging preferences' END_WARN
(In reply to Marcel de Rooy from comment #3) > What about: > > my $send_notices_pref = C4::Context->preference('AutoRenewalNotices'); > if ( $send_notices_pref eq 'cron' ) { > warn <<'END_WARN'; > > The "AutoRenewalNotices" syspref is set to 'Follow the cron switch'. > The send_notices switch for this script is deprecated, you should either set > the preference > to 'Never send emails' or 'Follow patron messaging preferences' > > END_WARN Sorry Marcel I wonder if there was more to add to your comment and it got left off? I don't understand the suggestion. Setting back to needs signoff.
Revisiting much too late. Trying to understand myself now..
(In reply to Marcel de Rooy from comment #3) > What about: > > my $send_notices_pref = C4::Context->preference('AutoRenewalNotices'); > if ( $send_notices_pref eq 'cron' ) { > warn <<'END_WARN'; > > The "AutoRenewalNotices" syspref is set to 'Follow the cron switch'. > The send_notices switch for this script is deprecated, you should either set > the preference > to 'Never send emails' or 'Follow patron messaging preferences' > > END_WARN Lets consider this out of scope for now. It is not related to EnhancedMessaging. It was just a question if we should add verbose here too. Never mind.
Created attachment 188766 [details] [review] Bug 38306: Only print EnhancedMessagingPreferences warning if run with verbose This enhancement will amend the automatic_renewals.pl script to only print a warning about the EnhancedMessagingPreferences system preference being disabled if the script was run with verbose. To test: 1. Disable EnhancedMessagingPreferences 2. Run misc/cronjobs/automatic_renewals.pl 3. Notice the warning is printed 4. Apply the patch and restart services 5. Run misc/cronjobs/automatic_renewals.pl and notice the warning is not printed 6. Run misc/cronjobs/automatic_renewals.pl --verbose and notice the warning is printed 7. Enable EnhancedMessagingPreferences 8. Run misc/cronjobs/automatic_renewals.pl and notice the warning is not printed Sponsored-by: Catalyst IT Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Pragmatic here. Theoretically, could imagine that I would like to see the warn when running this manually or so. But seeing this daily in the default cron call that does not have verbose, might be more annoying.
Nice work everyone! Pushed to main for 25.11