Bug 11756 - Hold ratios report sorting incorrectly
Summary: Hold ratios report sorting incorrectly
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-13 23:26 UTC by Barton Chittenden
Modified: 2015-06-04 23:30 UTC (History)
5 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:


Attachments
Screenshot of Hold ratios report at the reporting library (39.08 KB, image/png)
2014-02-13 23:26 UTC, Barton Chittenden
Details
Bug 11756 - Hold ratios report sorting incorrectly (2.13 KB, patch)
2014-02-14 14:02 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 11756 - Hold ratios report sorting incorrectly (2.16 KB, patch)
2014-02-15 07:48 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 11756 - Hold ratios report sorting incorrectly (2.16 KB, patch)
2014-02-18 14:47 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Barton Chittenden 2014-02-13 23:26:03 UTC
Created attachment 25237 [details]
Screenshot of Hold ratios report at the reporting library

In Home › Circulation › Hold ratios,

When rows are sorted by the hold count, the sort is alphabetic rather than numeric.

To replicate:

Check out 3 titles, A, B, C, each having a single item.
(The Holds Ratio report only shows titles with 3 or more holds per title)

Place 3 hold on title A
Place 4 holds on title B
Place 10 holds in title C

Bring up Hold Ratios report, and sort by the 'Holds' column

When ascending, they will sort

10  | C
3   | A
4   | B

They should sort

3   | A
4   | B
10  | C
Comment 1 Barton Chittenden 2014-02-13 23:39:51 UTC
The 'Items' column is also numeric, and also sorts alphabetically.
Comment 2 Owen Leonard 2014-02-14 14:02:06 UTC Comment hidden (obsolete)
Comment 3 Chris Cormack 2014-02-15 07:48:45 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2014-02-18 14:47:58 UTC
Created attachment 25374 [details] [review]
Bug 11756 - Hold ratios report sorting incorrectly

The DataTables plugin doesn't by default take multiple columns into
account when sorting. The hold ratios report presents a situation where
it makes sense to sort by default based on two columns: hold count and
title, since there are likely to be many titles with the same hold
count.

This patch adds sorting by default on holds (descending) and title
(ascending). It also modifies the configuration of the title sort to
exclude articles when sorting.

To test, view the hold ratios report. If necessary use the filter form
to reduce the minimum hold ratio and generate more results. Confirm that
the correct columns can be sorted.

Note that by default one can manually trigger sorting on two columns by
shift-clicking the second column header.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Comment 5 Galen Charlton 2014-02-18 23:50:12 UTC
Pushed to master.  Thanks Owen!
Comment 6 Fridolin Somers 2014-05-19 14:34:32 UTC
Pushed to 3.14.x, will be in 3.14.07
Comment 7 Kyle M Hall 2014-06-06 13:52:18 UTC
Pushed to 3.12.x will be in 3.12.13