Some libraries wish to track what the current location of items was at the time they were checked out. This will help libraries track which physical locations in the library patrons are more likely to check out a given book from.
Created attachment 64727 [details] [review] Bug 18882 - Add location code to statistics table for checkouts and renewals Some libraries wish to track what the current location of items was at the time they were checked out. This will help libraries track which physical locations in the library patrons are more likely to check out a given book from. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Check out an item that has a location set 4) Renew that item 5) View the checkout and renewal in the statistics table, verify each has the location column populated correctly
The code puts '' if there is no location key. But if the location key is NULL, because I hadn't set my shelving location, there is NULL. Do we want NULL's? If so, I'll sign this off. If not, could you tweak that?
Created attachment 64756 [details] [review] Bug 18882 [QA Followup] - Ensure stats with no or undef location are set to NULL in db
(In reply to M. Tompsett from comment #2) > The code puts '' if there is no location key. But if the location key is > NULL, because I hadn't set my shelving location, there is NULL. Do we want > NULL's? If so, I'll sign this off. If not, could you tweak that? I think we should always use NULL is the location is not passed or is set to undef. It seems like odd behavior to convert undef values to empty strings.
Created attachment 64758 [details] [review] Bug 18882 - Add location code to statistics table for checkouts and renewals Some libraries wish to track what the current location of items was at the time they were checked out. This will help libraries track which physical locations in the library patrons are more likely to check out a given book from. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Check out an item that has a location set 4) Renew that item 5) View the checkout and renewal in the statistics table, verify each has the location column populated correctly Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 64759 [details] [review] Bug 18882 [QA Followup] - Ensure stats with no or undef location are set to NULL in db Confirm that only NULL or a string are in the location field of the statistics table. Test with two items, one with shelving location set, and one without it set. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
(In reply to Kyle M Hall from comment #4) > (In reply to M. Tompsett from comment #2) > > The code puts '' if there is no location key. But if the location key is > > NULL, because I hadn't set my shelving location, there is NULL. Do we want > > NULL's? If so, I'll sign this off. If not, could you tweak that? > > I think we should always use NULL is the location is not passed or is set to > undef. It seems like odd behavior to convert undef values to empty strings. What we are doing now however, is storing undef only for location. Which is inconsistent. You change all lines in the second patch, only set undef for location. No blocker, but could be improved. I think that empty string would have been better now.
Created attachment 68911 [details] [review] Bug 18882 - Add location code to statistics table for checkouts and renewals Some libraries wish to track what the current location of items was at the time they were checked out. This will help libraries track which physical locations in the library patrons are more likely to check out a given book from. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Check out an item that has a location set 4) Renew that item 5) View the checkout and renewal in the statistics table, verify each has the location column populated correctly Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 68912 [details] [review] Bug 18882 [QA Followup] - Ensure stats with no or undef location are set to NULL in db Confirm that only NULL or a string are in the location field of the statistics table. Test with two items, one with shelving location set, and one without it set. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Pushed to master for 17.11, thanks to everybody involved!