Bug 15109

Summary: Regression in patron search results ordering
Product: Koha Reporter: Kyle M Hall <kyle>
Component: PatronsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: f.demians, gmcharlt, hector.hecaxmmx, jonathan.druart, katrin.fischer, kyle.m.hall, liz, tomascohen
Version: master   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7349
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15196
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 15109 - Regression in patron search results ordering
Bug 15109 - Regression in patron search results ordering
Bug 15109 - Regression in patron search results ordering
Bug 15109: Make name the default sort order for all patron searches
Bug 15109 - Regression in patron search results ordering
Bug 15109: Make name the default sort order for all patron searches
[PASSED QA] Bug 15109 - Regression in patron search results ordering
[PASSED QA] Bug 15109: Make name the default sort order for all patron searches

Description Kyle M Hall 2015-11-02 16:46:18 UTC
In Koha 3.16 or earlier, before the introduction of the ajax datatable for patron searching, the search results were ordered by name. In master, the results are currently ordered by cardnumber, which is not very useful.
Comment 1 Kyle M Hall 2015-11-02 16:48:31 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2015-11-02 20:36:45 UTC Comment hidden (obsolete)
Comment 3 Héctor Eduardo Castro Avalos 2015-11-02 23:48:22 UTC
Marc you forgot to change bug status.
Comment 4 Jonathan Druart 2015-11-13 09:15:49 UTC
There is already a DT sort parameter in the template:

  'aaSorting': [[1, 'asc']],

This one should be modified.
Moreover this script does not check for the existence of the checkboxes in the first column ([% IF CAN_user_tools_manage_patron_lists %]), which places the cardnumber in 0 or 1.
I will provide a counter patch.
Comment 5 Jonathan Druart 2015-11-13 09:22:44 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2015-11-13 09:22:49 UTC Comment hidden (obsolete)
Comment 7 Nicole C. Engard 2015-11-13 18:06:18 UTC Comment hidden (obsolete)
Comment 8 Nicole C. Engard 2015-11-13 18:06:24 UTC Comment hidden (obsolete)
Comment 9 Katrin Fischer 2015-11-16 20:19:21 UTC
Created attachment 44892 [details] [review]
[PASSED QA] Bug 15109 - Regression in patron search results ordering

In Koha 3.16 or earlier, before the introduction of the ajax datatable
for patron searching, the search results were ordered by name. In
master, the results are currently ordered by cardnumber, which is not
very useful.

Test Plan:
1) Do a "browse by last name" or a patron search
2) Note the results are sorted by card number
3) Apply this patch
4) Reload the page, start a new search
5) Note the results are sorted by name

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Katrin Fischer 2015-11-16 20:19:32 UTC
Created attachment 44893 [details] [review]
[PASSED QA] Bug 15109: Make name the default sort order for all patron searches

Find another place where there is a patron search (add user to a basket,
add users to a fund or edit owner of a fund, set a guarantor to a child,
etc.).
Do a search a confirm that the results are now sorted by name instead of
cardnumber.

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Tomás Cohen Arazi 2015-11-17 12:57:21 UTC
Patches pushed to master.

Thanks Jonathan!
Comment 12 Frédéric Demians 2015-11-29 21:08:10 UTC
This patch has been pushed to 3.20.x, will be in 3.20.6.
Comment 13 Liz Rea 2016-01-06 21:21:04 UTC
Pushed to 3.18.13, and released.