| Summary: | Make automatic_renewals.pl cronjob quiet if EnhancedMessagingPreferences syspref is off | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Aleisha Amohia <aleisha> |
| Component: | Command-line Utilities | Assignee: | Aleisha Amohia <aleisha> |
| Status: | Pushed to main --- | QA Contact: | Marcel de Rooy <m.de.rooy> |
| Severity: | enhancement | ||
| Priority: | P5 - low | CC: | lisette, m.de.rooy, robin |
| Version: | Main | Keywords: | no-sandbox |
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | Sponsored | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | Trivial patch |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: |
25.11.00
|
|
| Circulation function: | |||
| Attachments: |
Bug 38306: Only print EnhancedMessagingPreferences warning if run with verbose
Bug 38306: Only print EnhancedMessagingPreferences warning if run with verbose Bug 38306: Only print EnhancedMessagingPreferences warning if run with verbose |
||
|
Description
Aleisha Amohia
2024-10-31 00:10:31 UTC
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 |