Bug 27168

Summary: Most popular doesn't always sort correctly
Product: Koha Reporter: alexandra.speer
Component: OPACAssignee: Jonathan Druart <jonathan.druart>
Status: Pushed to stable --- QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: andrew, caroline.cyr-la-rose, fridolin.somers, jonathan.druart, katrin.fischer, victor
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.02
Bug Depends on:    
Bug Blocks: 9916    
Attachments: Screenshot of proper search
Screenshots of wrong results
Bug 27168: Sort most popular by number of issues desc
Bug 27168: Sort most popular by number of issues desc
Bug 27168: Sort most popular by number of issues desc
Bug 27168: [20.05.x] Sort most popular by number of issues desc

Description alexandra.speer 2020-12-08 11:27:02 UTC
Most popular should always sort most popular items on top, but it doesn't. 

- Turn on: OpacTopissue

Open the most popular page in the OPAC.
-> The records should appear correctly. 

Now change 
- Show the top filter to 20 titles and
- Acquired in the last to No limit
and Submit
-> The results are no longer sorted correctly by Checkouts.
Comment 1 Jonathan Druart 2020-12-09 13:16:56 UTC
Hello Alexandra, I don't recreate this behaviour on master. On which exact version of 20.05.x did you try?

Can you submit a the two screens?
Comment 2 Jonathan Druart 2020-12-09 13:17:15 UTC
(In reply to Jonathan Druart from comment #1)
> Can you submit a the two screens?

Can you submit a screenshot of the two screens?
Comment 3 alexandra.speer 2020-12-09 14:54:26 UTC
Created attachment 114283 [details]
Screenshot of proper search

Version tested: 20.05.05
Comment 4 alexandra.speer 2020-12-09 14:55:23 UTC
Created attachment 114284 [details]
Screenshots of wrong results
Comment 5 Jonathan Druart 2020-12-09 15:26:56 UTC
Coming from 
  commit 1b6452bc5422c998e0127822c5b3c47ff77355d1
  Bug 9916: (follow-up) restore default sort order for OPAC "most popular" page
Comment 6 Jonathan Druart 2020-12-09 15:29:40 UTC
Created attachment 114286 [details] [review]
Bug 27168: Sort most popular by number of issues desc

It seems that there is a weird behavior when the title is used as a
second sort

Test plan:
Turn on OpacTopissue
Make sure the table always displays entries sorted by number of issues
desc
Comment 7 Lucas Gass 2020-12-09 23:10:17 UTC
Created attachment 114292 [details] [review]
Bug 27168: Sort most popular by number of issues desc

It seems that there is a weird behavior when the title is used as a
second sort

Test plan:
Turn on OpacTopissue
Make sure the table always displays entries sorted by number of issues
desc

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 8 Katrin Fischer 2020-12-09 23:25:53 UTC
Thx Lucas!
Comment 9 Victor Grousset/tuxayo 2020-12-22 11:56:05 UTC
Created attachment 114600 [details] [review]
Bug 27168: Sort most popular by number of issues desc

It seems that there is a weird behavior when the title is used as a
second sort

Test plan:
Turn on OpacTopissue
Make sure the table always displays entries sorted by number of issues
desc

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 10 Jonathan Druart 2021-01-04 13:10:53 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 11 Fridolin Somers 2021-01-07 14:00:18 UTC
Pushed to 20.11.x for 20.11.02
Comment 12 Andrew Fuerste-Henry 2021-01-11 21:49:12 UTC
Doesn't apply cleanly to 20.05, please rebase if needed
Comment 13 Katrin Fischer 2021-01-11 21:58:57 UTC
This bug was initially found in 20.05, so a rebase would be great.
Comment 14 Jonathan Druart 2021-01-12 08:47:02 UTC
Created attachment 115049 [details] [review]
Bug 27168: [20.05.x] Sort most popular by number of issues desc

It seems that there is a weird behavior when the title is used as a
second sort

Test plan:
Turn on OpacTopissue
Make sure the table always displays entries sorted by number of issues
desc
Comment 15 Jonathan Druart 2021-01-12 08:47:13 UTC
Patch rebased but not tested.