As we understand it the totals in the last line of the statistics table in the patron account should be always the same, independent of the selection made in the StatisticsFields system preference. This is not the case. When "location" is removed, the total is less than with "location". I think this might have something to do with the group and empty values for some entries, but have not been able to find the problem yet.
Screenshots? Which values are different?
- Use a patron who hasn't checked out items before - Set StatisticsFields to itype|ccode - Check out some items without location - Verify that statistics stable shows the correct number of checkouts - Check out one item with a location or just change one of your checked out items - Verify the total is still correct - Change StatisticsFields to location|itype|ccode - Verify the total has changed now - it's only 1 (the one with a location)
I retested it on master... not quite the same result as last time, but still something strange going on here. Hope the test plan works for you.
Created attachment 76874 [details] statistics tab
Created attachment 76875 [details] current checkouts
For the screenshot the pref was set to location|itype|ccode. If location is removed, the number of checkouts shows as 2 (which is correct). Note: in the screenshot, the shelving location is also not shown?
Created attachment 88990 [details] [review] Bug 21027; Fix checkout statistics if 1+ of the fields is not defined
Hi Katrin, I think this patch fixes the problem you faced. I did not read a test plan as I have to admit I completely forgot about that code and not sure how the changes could be completely tested.
Created attachment 89008 [details] Screenshot_total_checkouts without patch
Created attachment 91455 [details] [review] Bug 21027; Fix checkout statistics if 1+ of the fields is not defined TEST - Use a patron who hasn't checked out items before - Set StatisticsFields to itype|ccode - Check out some items without location - Verify that statistics stable shows the correct number of checkouts - Check out one item with a location or just change one of your checked out items - Verify the total is still correct - Change StatisticsFields to location|itype|ccode - Verify the total has changed now - it's only 1 (the one with a location) Apply the patch and try again Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Created attachment 91472 [details] [review] Bug 21027: Fix checkout statistics if 1+ of the fields is not defined TEST - Use a patron who hasn't checked out items before - Set StatisticsFields to itype|ccode - Check out some items without location - Verify that statistics stable shows the correct number of checkouts - Check out one item with a location or just change one of your checked out items - Verify the total is still correct - Change StatisticsFields to location|itype|ccode - Verify the total has changed now - it's only 1 (the one with a location) Apply the patch and try again Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Nice work! Pushed to master for 19.11.00
Pushed to 19.05.x for 19.05.03
backported to 18.11.x for 18.11.09