Bug 21778 - Sorting is inconsistent on patron search based on permissions
Summary: Sorting is inconsistent on patron search based on permissions
Status: Pushed to Stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Target Milestone: ---
Assignee: Bugs List
QA Contact: Josef Moravec
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-07 01:32 UTC by Nick Clemens
Modified: 2019-01-02 09:35 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 21778: Sort user list by surname,firstname unless user cannot manage patron lists OR edit patrons (1.58 KB, patch)
2018-11-07 01:36 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 21778: Sort user list by surname,firstname unless user cannot manage patron lists OR edit patrons (1.64 KB, patch)
2018-11-30 08:55 UTC, Devinim
Details | Diff | Splinter Review
Bug 21778: Sort user list by surname,firstname unless user cannot manage patron lists OR edit patrons (1.69 KB, patch)
2018-12-05 16:21 UTC, Josef Moravec
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2018-11-07 01:32:00 UTC
When searching for patrons the results are sorted by surname, firstname if 
CAN_user_tools_manage_patron_lists

otherwise they are sorted by cardnumber

This seems to be a confusion in the template - the checkbox column is only hidden if the user cannot edit patrons or add them to a list, however, the sorting assumes it is hidden if they cannot add patrons to a list
Comment 1 Nick Clemens 2018-11-07 01:36:27 UTC
Created attachment 82015 [details] [review]
Bug 21778: Sort user list by surname,firstname unless user cannot manage patron lists OR edit patrons

To test:
1 - Create four users:
    1 superlibrarian (or with both edit patrons and manage patron
            lists)
    1 with only edit patrons and catalogue
    1 with only add to list and catalogue
    1 with catalogue but neither edit patrons or manage patron lists
2 - Search patrons signed in as each user
3 - Note different sorting
4 - Apply patch
5 - Try searching with each patron
6 - Results should always be sorted by surname, firstname
7 - Only in the case of neither extra permission should the checkboxes
be absent
Comment 2 Devinim 2018-11-30 08:55:19 UTC
Created attachment 82768 [details] [review]
Bug 21778: Sort user list by surname,firstname unless user cannot manage patron lists OR edit patrons

To test:
1 - Create four users:
    1 superlibrarian (or with both edit patrons and manage patron
            lists)
    1 with only edit patrons and catalogue
    1 with only add to list and catalogue
    1 with catalogue but neither edit patrons or manage patron lists
2 - Search patrons signed in as each user
3 - Note different sorting
4 - Apply patch
5 - Try searching with each patron
6 - Results should always be sorted by surname, firstname
7 - Only in the case of neither extra permission should the checkboxes
be absent

It worked as described.

Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
Comment 3 Josef Moravec 2018-12-03 20:25:34 UTC
Nick,

if we want the sorting to be always consistant, why not to even remove the whole condition?
Comment 4 Nick Clemens 2018-12-03 20:29:51 UTC
if they have neither of those permissions there won't be the extra column, we will sort by the first column so we need the test to know if we wort on index 1 or 2


if we can name the column using class or something for sort instead of using the index that could avoid the conditions
Comment 5 Josef Moravec 2018-12-05 16:21:35 UTC
Created attachment 82876 [details] [review]
Bug 21778: Sort user list by surname,firstname unless user cannot manage patron lists OR edit patrons

To test:
1 - Create four users:
    1 superlibrarian (or with both edit patrons and manage patron
            lists)
    1 with only edit patrons and catalogue
    1 with only add to list and catalogue
    1 with catalogue but neither edit patrons or manage patron lists
2 - Search patrons signed in as each user
3 - Note different sorting
4 - Apply patch
5 - Try searching with each patron
6 - Results should always be sorted by surname, firstname
7 - Only in the case of neither extra permission should the checkboxes
be absent

Signed-off-by: Devinim <kohadevinim@devinim.com.tr>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 6 Nick Clemens 2018-12-11 20:56:40 UTC
Awesome work all!

Pushed to master for 19.05
Comment 7 Martin Renvoize 2018-12-12 10:42:48 UTC
Pushed to 18.11.x for 18.11.01
Comment 8 Fridolin SOMERS 2019-01-02 09:35:24 UTC
Pushed to 18.05.x for 18.05.08