Bugzilla – Attachment 140100 Details for
Bug 30755
auto_too_soon should not be counted as an error in autorenewals
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30755: (follow-up) Add a results hash to automatic renewals
Bug-30755-follow-up-Add-a-results-hash-to-automati.patch (text/plain), 3.20 KB, created by
Martin Renvoize (ashimema)
on 2022-09-02 10:22:07 UTC
(
hide
)
Description:
Bug 30755: (follow-up) Add a results hash to automatic renewals
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-09-02 10:22:07 UTC
Size:
3.20 KB
patch
obsolete
>From fa23c847968f67f2206e5f4005c47a300de5d3cc Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 2 Sep 2022 07:52:15 +0000 >Subject: [PATCH] Bug 30755: (follow-up) Add a results hash to automatic > renewals > >It's slightly debatable whether auto_too_soon is an error or not. I think >it leans far enough towards error that the other patch is correct. The change, however, >will affect notices and means we cannot count auto_too_soon anymore > >This patch adds a new 'results' hash to the info - this includes a count per error >(including auto_renew i.e. success) allowing for notices to decide how to display the info. > >To test: >1 - Add to Auto renew digest notice: >[% IF results %] >There were [% results.auto_too_soon %] items that were too soon. >[% END %] >2 - Check out some items to a patron that will be too soon >3 - Check out one that is not too soon and will renew >4 - Ensure patron has auto renew digest selected and that AutoRenewalNotices is set to follow patron preferences >5 - Run the auto renewals cron >6 - Confirm the notice for the patron displays 1 successful renewal, no failures, and a correct count of too_soon > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > misc/cronjobs/automatic_renewals.pl | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/misc/cronjobs/automatic_renewals.pl b/misc/cronjobs/automatic_renewals.pl >index d3157d1f1d..55d8445f73 100755 >--- a/misc/cronjobs/automatic_renewals.pl >+++ b/misc/cronjobs/automatic_renewals.pl >@@ -203,11 +203,13 @@ while ( my $auto_renew = $auto_renews->next ) { > 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 }->{results}->{$error}++ ; > push @{$renew_digest->{ $auto_renew->branchcode }->{ $auto_renew->borrowernumber }->{issues}}, $auto_renew->itemnumber; > $renew_digest->{ $auto_renew->branchcode }->{ $auto_renew->borrowernumber }->{updated} = 1 if $updated && $error ne 'auto_too_soon'; > } 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 }->{results}->{$error}++ ; > $renew_digest->{ $auto_renew->borrowernumber }->{updated} = 1 if $updated && $error ne 'auto_too_soon'; > push @{$renew_digest->{ $auto_renew->borrowernumber }->{issues}}, $auto_renew->itemnumber; > } >@@ -322,6 +324,7 @@ sub send_digests { > substitute => { > error => $digest->{error}||0, > success => $digest->{success}||0, >+ results => $digest->{results}, > }, > loops => { issues => \@{$digest->{issues}} }, > tables => { >-- >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 30755
:
135224
|
140078
|
140079
|
140099
| 140100