Bug 17801 - 'Top Most-circulated items' gives wrong results when filtering by checkout date
Summary: 'Top Most-circulated items' gives wrong results when filtering by checkout date
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Andrew Fuerste-Henry
QA Contact: Testopia
URL:
Keywords:
: 12628 (view as bug list)
Depends on:
Blocks: 10188
  Show dependency treegraph
 
Reported: 2016-12-21 08:55 UTC by Katrin Fischer
Modified: 2022-06-06 20:25 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.04, 19.11.10


Attachments
Bug 17801: Use issuedate for limits in Most Circulated Items (5.98 KB, patch)
2020-08-27 18:05 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 17801: Use issuedate for limits in Most Circulated Items (6.04 KB, patch)
2020-09-03 08:42 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 17801: Use issuedate for limits in Most Circulated Items (6.11 KB, patch)
2020-09-03 09:12 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2016-12-21 08:55:09 UTC
We had a library reporting that records show up on this report that haven't been checked out within the selected date range of checkout dates.

After looking at the script I think this is because it checks the timestamp column instead of the issuedate of old_issues.

In old_issues the timestamp is the date of return, so that's not right and explains the results the library reported.

Side note: the report does also not seem to count current checkouts as it avoids the issues table?
Comment 1 Katrin Fischer 2019-04-26 09:21:19 UTC
Appears to be still valid.
Comment 2 Andrew Fuerste-Henry 2020-08-27 17:10:47 UTC
+1, still valid
Comment 3 Andrew Fuerste-Henry 2020-08-27 18:05:53 UTC
Created attachment 109246 [details] [review]
Bug 17801: Use issuedate for limits in Most Circulated Items

To test:
1 - Have two checkouts in old_issues
    issue 1: timestamp 2020-08-01 00:00:00, issuedate 2019-08-01 00:00:00
    issue 2: timestamp 2020-07-01 00:00:00, issuedate 2019-07-01 00:00:00
2 - Perform a Most Circulated Items search for checkout dates 2020-06-01 to 2020-09-01. Both checkouts appear in search
3 - Repeat search with checkout dates 2019-06-01 to 2019-09-01. Neither checkout appears in search
4 - apply patch, restart all
5 - Repeat search with checkout dates 2020-06-01 to 2020-09-01. Neither checkout appears in search
6 - Repeat search with checkout dates 2019-06-01 to 2019-09-01. Both checkouts appears in search
Comment 4 Fridolin Somers 2020-09-03 08:42:34 UTC
Created attachment 109588 [details] [review]
Bug 17801: Use issuedate for limits in Most Circulated Items

To test:
1 - Have two checkouts in old_issues
    issue 1: timestamp 2020-08-01 00:00:00, issuedate 2019-08-01 00:00:00
    issue 2: timestamp 2020-07-01 00:00:00, issuedate 2019-07-01 00:00:00
2 - Perform a Most Circulated Items search for checkout dates 2020-06-01 to 2020-09-01. Both checkouts appear in search
3 - Repeat search with checkout dates 2019-06-01 to 2019-09-01. Neither checkout appears in search
4 - apply patch, restart all
5 - Repeat search with checkout dates 2020-06-01 to 2020-09-01. Neither checkout appears in search
6 - Repeat search with checkout dates 2019-06-01 to 2019-09-01. Both checkouts appears in search

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Comment 5 Fridolin Somers 2020-09-03 08:43:13 UTC
Indeed, timestamp can not be trusted.
Nice work ;)
Comment 6 Martin Renvoize 2020-09-03 09:12:32 UTC
Created attachment 109597 [details] [review]
Bug 17801: Use issuedate for limits in Most Circulated Items

To test:
1 - Have two checkouts in old_issues
    issue 1: timestamp 2020-08-01 00:00:00, issuedate 2019-08-01 00:00:00
    issue 2: timestamp 2020-07-01 00:00:00, issuedate 2019-07-01 00:00:00
2 - Perform a Most Circulated Items search for checkout dates 2020-06-01 to 2020-09-01. Both checkouts appear in search
3 - Repeat search with checkout dates 2019-06-01 to 2019-09-01. Neither checkout appears in search
4 - apply patch, restart all
5 - Repeat search with checkout dates 2020-06-01 to 2020-09-01. Neither checkout appears in search
6 - Repeat search with checkout dates 2019-06-01 to 2019-09-01. Both checkouts appears in search

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2020-09-03 09:13:52 UTC
Another nice old one to have squelched.

Works well, trivial patch..

Passing QA
Comment 8 Fridolin Somers 2020-09-03 09:17:04 UTC
> Side note: the report does also not seem to count current checkouts as it avoids the issues table?
See Bug 10188
Comment 9 Fridolin Somers 2020-09-03 09:18:01 UTC
*** Bug 12628 has been marked as a duplicate of this bug. ***
Comment 10 Jonathan Druart 2020-09-03 13:04:18 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 11 Fridolin Somers 2020-09-10 07:12:03 UTC
A lot of libraries have seen this bug, please backport to stable branches.
Comment 12 Lucas Gass 2020-09-14 21:48:22 UTC
backported to 20.05.x for 20.05.04
Comment 13 Aleisha Amohia 2020-09-15 11:49:38 UTC
backported to 19.11.x for 19.11.10
Comment 14 Fridolin Somers 2020-09-17 10:50:27 UTC
Great :D thanks a lot
Comment 15 Victor Grousset/tuxayo 2020-09-20 19:22:57 UTC
Not backported to oldoldstable (19.05.x). Feel free to ask if it's needed.