Bug 16184

Summary: Report bor_issues_top shows incorrect number of rows
Product: Koha Reporter: Mason James <mtj>
Component: ReportsAssignee: Galen Charlton <gmcharlt>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: brendan, f.demians, julian.maurice, mtompset
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 16184 - Report bor_issues_top shows incorrect number of rows
before/after pic
Bug 16184 - Report bor_issues_top shows incorrect number of rows
[PASSED QA] Bug 16184 - Report bor_issues_top shows incorrect number of rows

Comment 1 Mason James 2016-04-01 03:00:04 UTC
This report always returns double the number of rows requested
Comment 2 Mason James 2016-04-01 03:01:51 UTC Comment hidden (obsolete)
Comment 3 Mason James 2016-04-01 03:03:03 UTC
Created attachment 49761 [details]
before/after pic
Comment 4 Mason James 2016-04-01 03:04:51 UTC
A report with a LIMIT of 5 rows, will incorrectly return 10 rows (bad!)
Comment 5 Mark Tompsett 2016-04-01 04:21:55 UTC
I'm not sure whether this patch is the best way to do it.
The whole query issues and old_issues via Perl seems like the wrong way to handle the logic. I'm sure a better SQL query could be built with a UNION that way the LIMIT and GROUP BY would be handled by MySQL instead.
Comment 6 Mark Tompsett 2016-04-01 04:32:08 UTC Comment hidden (obsolete)
Comment 7 Katrin Fischer 2016-04-03 13:06:46 UTC
Created attachment 49821 [details] [review]
[PASSED QA] Bug 16184 - Report bor_issues_top shows incorrect number of rows

TEST PLAN
---------
1) Have at least 6 patrons with checkouts and some checkins.
2) Reports -> Patrons with the most checkouts
3) Click 'Submit' (default is 5)
   -- more than 5 entries listed.
4) Apply patch
5) Refresh page
   -- only 5 entries listed.
6) Run koha qa test tools

NOTE: While this works, I'd be much happier with a refactor
      as it would also speed up the report. See comment #5.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Brendan Gallagher 2016-04-06 22:11:01 UTC
Pushed to Master - Should be in the May 2016 Release.  Thanks!
Comment 9 Julian Maurice 2016-04-07 08:22:18 UTC
Patch pushed to 3.22.x, will be in 3.22.6
Comment 10 Frédéric Demians 2016-04-27 15:35:37 UTC
Pushed to 3.22.x, will be in 3.20.11.