As of 19.05, statistics.branch is null when recording a renewal performed by the auto-renew cron. Prior to 19.05, a branch was recorded (though I'm not clear if that was the branch whose rules were used or the branch from the issues table). It looks like this was changed by bug 22600.
This causes significant statistical differences in circulation numbers post upgrade. I think this is a regression and should be addressed.
Created attachment 97438 [details] [review] Bug 24377: Unit test
Created attachment 97439 [details] [review] Bug 24377: Record passed branch if renewing via cron To test: 1 - Checkout an item with auto renewal set and eligible for auto renew 2 - Set no renewal before in the circ rules to 99 (something greater than the checkout period) 3 - perl misc/cronjobs/automatic_renewals.pl 4 - Check the statistics table, note the branch for renewal is null SELECT * FROM statistics WHERE itemnumber={itemnumber} AND type='RENEWAL' 5 - Apply patch 6 - Repeat 1-4 7 - Note the branch is set to the issuing branch
Created attachment 97441 [details] [review] Bug 24377: Unit test Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 97442 [details] [review] Bug 24377: Record passed branch if renewing via cron To test: 1 - Checkout an item with auto renewal set and eligible for auto renew 2 - Set no renewal before in the circ rules to 99 (something greater than the checkout period) 3 - perl misc/cronjobs/automatic_renewals.pl 4 - Check the statistics table, note the branch for renewal is null SELECT * FROM statistics WHERE itemnumber={itemnumber} AND type='RENEWAL' 5 - Apply patch 6 - Repeat 1-4 7 - Note the branch is set to the issuing branch Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 97453 [details] [review] Bug 24377: Record passed branch if renewing via cron To test: 1 - Checkout an item with auto renewal set and eligible for auto renew 2 - Set no renewal before in the circ rules to 99 (something greater than the checkout period) 3 - perl misc/cronjobs/automatic_renewals.pl 4 - Check the statistics table, note the branch for renewal is null SELECT * FROM statistics WHERE itemnumber={itemnumber} AND type='RENEWAL' 5 - Apply patch 6 - Repeat 1-4 7 - Note the branch is set to the issuing branch Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Ed Veal <eveal@mckinneytexas.org>
Bumping to major, this causes data loss for statistics
Created attachment 98167 [details] [review] Bug 24377: Unit test Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 98168 [details] [review] Bug 24377: Record passed branch if renewing via cron To test: 1 - Checkout an item with auto renewal set and eligible for auto renew 2 - Set no renewal before in the circ rules to 99 (something greater than the checkout period) 3 - perl misc/cronjobs/automatic_renewals.pl 4 - Check the statistics table, note the branch for renewal is null SELECT * FROM statistics WHERE itemnumber={itemnumber} AND type='RENEWAL' 5 - Apply patch 6 - Repeat 1-4 7 - Note the branch is set to the issuing branch Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Ed Veal <eveal@mckinneytexas.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Yikes, that is not a side effect I had imagined.. sorry guys. Thanks for the quick fix Nick.. passing QA
Nice work everyone! Pushed to master for 20.05
Pushed to 19.11.x branch for 19.11.03
backported to 19.05.x for 19.05.08