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!
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'.
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.