Bug 28263

Summary: AUTO_RENEWALS message for 'too_many' is wrong
Product: Koha Reporter: Lucas Gass <lucas>
Component: NoticesAssignee: Lucas Gass <lucas>
Status: CLOSED FIXED QA Contact: Joonas Kylmälä <joonas.kylmala>
Severity: minor    
Priority: P5 - low CC: david, hayleypelham, joonas.kylmala, kyle
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: String patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This corrects the text in the AUTO_RENEWALS and AUTO_RENEWALS_DGST notices. These are sent when an item is setup for automatic renewal and can no longer be automatically renewed as the maximum number of renewals reached: - Current wording: "You have reached the maximum number of checkouts possible." - Updated wording: "You have reached the maximum number of renewals possible." For new installations the sample notices are updated. For existing installations the notices will be updated if they exist and haven't been changed.
Version(s) released in:
21.11.00
Attachments: Bug 28263: Fix too_many auto renewal message
Bug 28263: Fix too_many auto renewal message
Bug 28263: Fix too_many auto renewal message
Bug 28263: Fix too_many auto renewal message
Bug 28263: (QA follow-up) Use new atomicupdate code style

Description Lucas Gass 2021-04-29 14:28:21 UTC
When the AUTO_RENEWAL message generates the error 'too_many' the standard template displays the message 'You have reached the maximum number of checkouts possible.'

This is not correct. It should read: 'You have reached the maximum number of renewals possible.'
Comment 1 Lucas Gass 2021-04-29 14:41:26 UTC
Created attachment 120315 [details] [review]
Bug 28263: Fix too_many auto renewal message

To test:
1. Make an item eligible for auto_renewal.
2. Set circ rule so only 1 auto_renewal is allowd.
3. Run auto_renew once, get a successful message.
4. Run it again and get the too_many error "You have reached the maximum number of checkouts possible."
5. This has nothing to do with the number of checkouts
6. Apply patch and updatedatabase.
7. Do 1-4 again.
8. Message is now "You have reached the maximum number of renewals possible."
Comment 2 Katrin Fischer 2021-06-04 00:09:21 UTC
Hi Lucas,

with the new additions in 21.05 we also need to fix AUTO_RENEWALS_DGST now. And for new installations we need sample_notices.yml fixed.
Comment 3 Lucas Gass 2021-06-29 15:19:22 UTC
Created attachment 122495 [details] [review]
Bug 28263: Fix too_many auto renewal message

To test:
1. Make an item eligible for auto_renewal.
2. Set circ rule so only 1 auto_renewal is allowd.
3. Run auto_renew once, get a successful message.
4. Run it again and get the too_many error "You have reached the maximum number of checkouts possible."
5. This has nothing to do with the number of checkouts
6. Apply patch and updatedatabase.
7. Do 1-4 again.
8. Message is now "You have reached the maximum number of renewals possible."
Comment 4 Hayley Pelham 2021-09-03 01:16:52 UTC
Hi Lucas,

Can you please elaborate on how you can 'run auto_renew'?

Cheers,
Hayley
Comment 5 Lucas Gass 2021-09-03 13:59:51 UTC
(In reply to Hayley Pelham from comment #4)
> Hi Lucas,
> 
> Can you please elaborate on how you can 'run auto_renew'?
> 
> Cheers,
> Hayley

Hi Hayley,

I'm sorry, that wasn't very clear. What I mean by 'run auto_renew' is to run the automatic renewal script ( /misc/cronjobs/automatic_renewals.pl ).
Comment 6 David Nind 2021-10-22 20:18:45 UTC
Created attachment 126787 [details] [review]
Bug 28263: Fix too_many auto renewal message

To test:
1. Make an item eligible for auto_renewal.
2. Set circ rule so only 1 auto_renewal is allowd.
3. Run auto_renew once, get a successful message.
4. Run it again and get the too_many error "You have reached the maximum number of checkouts possible."
5. This has nothing to do with the number of checkouts
6. Apply patch and updatedatabase.
7. Do 1-4 again.
8. Message is now "You have reached the maximum number of renewals possible."

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 David Nind 2021-10-22 20:35:53 UTC
My testing notes (koha-testing-docker):

1. Setup so notice generated: 
   . Change AutoRenewalNotices to 'according to patron messaging preferences'
   . Add an email address for a patron
   . Tick email for auto renewal under messaging references for the patron
2. Check out an item for the patron - when checking out expand the checkout settings and tick the automatic renewal box, and change the renewal date to before today
3. Run the auto renewal script: misc/cronjobs/automatic_renewals.pl -c -s -v
   => result (numbers will be different depending on item and patron):
    getting auto renewals
    found 1 auto renewals
    examining item '578' to auto renew
    Issue id: 3 for borrower: 49 and item: 578 will be renewed.
4. Check patron's notices - automatic renewal notice should say the renewal was successful 
5. Run auto renewal script again (step 3) - result will be:
    getting auto renewals
    found 1 auto renewals
    examining item '578' to auto renew
    Issue id: 3 for borrower: 49 and item: 578 will be renewed.6. 
6. Check patron's notices - automatic renewal notice should say not renewed
7. Checked diff and reviewed changes
8. After patch applied, renewal notice (under Tools > Notices & slips) and patron's notices should reflect updated wording
Comment 8 Joonas Kylmälä 2021-10-30 18:15:31 UTC
Created attachment 127108 [details] [review]
Bug 28263: Fix too_many auto renewal message

To test:
1. Make an item eligible for auto_renewal.
2. Set circ rule so only 1 auto_renewal is allowd.
3. Run auto_renew once, get a successful message.
4. Run it again and get the too_many error "You have reached the maximum number of checkouts possible."
5. This has nothing to do with the number of checkouts
6. Apply patch and updatedatabase.
7. Do 1-4 again.
8. Message is now "You have reached the maximum number of renewals possible."

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 9 Joonas Kylmälä 2021-10-30 20:59:04 UTC
Created attachment 127110 [details] [review]
Bug 28263: (QA follow-up) Use new atomicupdate code style

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 10 Jonathan Druart 2021-11-02 15:53:07 UTC
Pushed to master for 21.11, thanks to everybody involved!