Bug 41437 - Patrons should never receive two consecutive auto renewal failure notices
Summary: Patrons should never receive two consecutive auto renewal failure notices
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Lucas Gass (lukeg)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-11 21:48 UTC by Lucas Gass (lukeg)
Modified: 2025-12-17 14:54 UTC (History)
3 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
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:
Circulation function:


Attachments
Bug 41437: Prevent sending an auto renewal failure if one already exists (6.22 KB, patch)
2025-12-17 14:22 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass (lukeg) 2025-12-11 21:48:13 UTC
To recreate:

0. Set RestrictionBlockRenewing to 'block'
1. Set up a patron for auto rewenal and then check something out to them. Make sure the patron has an email address and has messaging preferences set to receive auto renewals. 
2. Now do something that would make an auto renewal fail. I placed the item from step 1 on hold for someone else.
2. Run the auto renewals cron ( perl /kohadevbox/koha/misc/cronjobs/automatic_renewals.pl -c -v )
3. A notice should be generated telling the patron the thing cannot renew with the error code of `on_reserve`. ( good )
4. Restrict the patron, doing this manually is fine. 
5. Run the auto renewals cron again.
6. Another auto rewenal is sent tell the patron the thing cannot renew with the error code `restriction`. ( bad )

This is confusing. The item is still on hold, we shouldn't inform the patron that the items cannot auto renew, they already know!
Comment 1 Lucas Gass (lukeg) 2025-12-17 13:09:45 UTC
I think we should be checking the previous auto renewal error, if it exists we should send a new failure notice. The exception is 'auto_too_soon'.
Comment 2 Lucas Gass (lukeg) 2025-12-17 14:22:24 UTC
Created attachment 190584 [details] [review]
Bug 41437: Prevent sending an auto renewal failure if one already exists

To test:
0. Set RestrictionBlockRenewing to 'block'
1. Set up a patron for auto rewenal and then check something out to them. Make sure the patron has an email address and has messaging preferences set to receive auto renewals.
2. Now do something that would make an auto renewal fail. I placed the item from step 1 on hold for someone else.
2. Run the auto renewals cron ( perl /kohadevbox/koha/misc/cronjobs/automatic_renewals.pl -c -v )
3. A notice should be generated telling the patron the thing cannot renew with the error code of `on_reserve`. ( good )
4. Restrict the patron, doing this manually is fine.
5. Run the auto renewals cron again.
6. Another auto renewal is sent tell the patron the thing cannot renew with the error code `restriction`. ( bad )
7. APPLY PATCH, restart_all
8. Reset the test plan and try all the steps again. Tthis time at step 8 you should NOT get a 2nd consecutive failure notice.
9. Lift the restriction and run the automatic_renewals.pl script once again, you shold get a notice that the renewal succeeds.
10. Repeat this process for digest notices.