Bugzilla – Attachment 127141 Details for
Bug 29381
Auto-renewal digest messages are sent on every cron run
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29381: Prevent sending of automatic renewal messages on every cron run
Bug-29381-Prevent-sending-of-automatic-renewal-mes.patch (text/plain), 3.04 KB, created by
Joonas Kylmälä
on 2021-10-31 15:08:17 UTC
(
hide
)
Description:
Bug 29381: Prevent sending of automatic renewal messages on every cron run
Filename:
MIME Type:
Creator:
Joonas Kylmälä
Created:
2021-10-31 15:08:17 UTC
Size:
3.04 KB
patch
obsolete
>From 93690b65402f556b8cb29e746146481585b62080 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <joonas.kylmala@iki.fi> >Date: Sun, 31 Oct 2021 14:52:50 +0000 >Subject: [PATCH] Bug 29381: Prevent sending of automatic renewal messages on > every cron run > >Currently the auto-renewal digest messages are sent on every cron run >even if there was nothing to renew or no renewal errors. > >This regression was introduced in the commit "Bug 18532: Add >individual issues to digest notice and hide auto_renewals messaging >preference when not needed". > >To test: > 1) set syspref AutoRenewalNotices to be according to patron > preferences > 2) Enable renewal digest messages on a patron's messaging preferences > 3) Checkout a book for patron, during the checkout use the Checkout > settings menu to check the box "Automatic renewal" > 4) Run > $ perl misc/cronjobs/automatic_renewals.pl --send-notices --confirm --digest-per-branch > $ perl misc/cronjobs/automatic_renewals.pl --send-notices --confirm --digest-per-branch > 5) Notice you have now two renewal messages for the patron > 6) Apply patch > 7) repeat step 4) and notice you don't get anymore these unnecessary > renewal messages >--- > misc/cronjobs/automatic_renewals.pl | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/misc/cronjobs/automatic_renewals.pl b/misc/cronjobs/automatic_renewals.pl >index cb45e68cbd..7979ebbb2f 100755 >--- a/misc/cronjobs/automatic_renewals.pl >+++ b/misc/cronjobs/automatic_renewals.pl >@@ -179,15 +179,15 @@ while ( my $auto_renew = $auto_renews->next ) { > } > } > >- if ( $borrower_preferences && $borrower_preferences->{transports} && $borrower_preferences->{transports}->{email} && $borrower_preferences->{'wants_digest'} ) { >+ if ( $error ne 'auto_too_soon' && $borrower_preferences && $borrower_preferences->{transports} && $borrower_preferences->{transports}->{email} && $borrower_preferences->{'wants_digest'} ) { > # cache this one to process after we've run through all of the items. > if ($digest_per_branch) { > $renew_digest->{ $auto_renew->branchcode }->{ $auto_renew->borrowernumber }->{success}++ if $error eq 'auto_renew'; >- $renew_digest->{ $auto_renew->branchcode }->{ $auto_renew->borrowernumber }->{error}++ unless $error eq 'auto_renew' || $error eq 'auto_too_soon' ; >+ $renew_digest->{ $auto_renew->branchcode }->{ $auto_renew->borrowernumber }->{error}++ unless $error eq 'auto_renew'; > push @{$renew_digest->{ $auto_renew->branchcode }->{ $auto_renew->borrowernumber }->{issues}}, $auto_renew->itemnumber; > } else { > $renew_digest->{ $auto_renew->borrowernumber }->{success} ++ if $error eq 'auto_renew'; >- $renew_digest->{ $auto_renew->borrowernumber }->{error}++ unless $error eq 'auto_renew' || $error eq 'auto_too_soon' ; >+ $renew_digest->{ $auto_renew->borrowernumber }->{error}++ unless $error eq 'auto_renew'; > push @{$renew_digest->{ $auto_renew->borrowernumber }->{issues}}, $auto_renew->itemnumber; > } > } >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29381
:
127141
|
127416
|
127947