Bug 5634 - Ordering branches should be case independent
Summary: Ordering branches should be case independent
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Paul Poulain
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-19 20:47 UTC by Paul Poulain
Modified: 2013-12-05 20:04 UTC (History)
5 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
patch (1.14 KB, patch)
2011-01-20 01:19 UTC, Nicole C. Engard
Details | Diff | Splinter Review
Screenshot of incorrect sort (9.91 KB, image/png)
2011-02-24 21:11 UTC, Owen Leonard
Details
Screenshot of correct sort (9.85 KB, image/png)
2011-02-24 21:14 UTC, Owen Leonard
Details
Branch order on login page still incorrect (9.28 KB, image/png)
2011-02-24 21:17 UTC, Owen Leonard
Details
Branch sort on patron entry screen still incorrect (8.72 KB, image/png)
2011-02-24 21:19 UTC, Owen Leonard
Details
Follow-up Bug 5634: Ordering branches should be case independent (2.69 KB, patch)
2012-12-19 18:57 UTC, Nadia Nicolaides
Details | Diff | Splinter Review
Follow-up Bug 5634: Ordering branches should be case independent (2.75 KB, patch)
2012-12-19 19:16 UTC, Chris Cormack
Details | Diff | Splinter Review
Follow-up Bug 5634: Ordering branches should be case independent (2.94 KB, patch)
2012-12-21 11:05 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 5634 - Followup - Ordering branches should be case independent (28.69 KB, patch)
2013-01-09 18:50 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Poulain 2011-01-19 20:47:10 UTC
Some libraries use lower case & upper case in branch description. The list is ordered case sensitively, it's hard to read.
The patch will order the list case insensively.
Comment 1 Nicole C. Engard 2011-01-20 01:19:27 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2011-01-20 07:23:35 UTC
Patch pushed, please test
Comment 3 MJ Ray (software.coop) 2011-02-06 11:13:49 UTC
This bug is mentioned in:
Bug 5634: BZ5634 order branch	list alphabetically, without taking care of uc/lc http://lists.koha-community.org/pipermail/koha-patches/2011-January/013676.html
Comment 4 Owen Leonard 2011-02-24 21:11:58 UTC
Created attachment 3213 [details]
Screenshot of incorrect sort
Comment 5 Owen Leonard 2011-02-24 21:14:03 UTC
Created attachment 3214 [details]
Screenshot of correct sort

The accepted patch fixes instances where the branch list is generated by GetBranchesLoop. Other branch lists are unaffected and will still show an incorrect sort. I think this bug should remain open until all instances are consistent.
Comment 6 Owen Leonard 2011-02-24 21:17:43 UTC
Created attachment 3215 [details]
Branch order on login page still incorrect

The order of branches on the login page is not only sorted incorrectly with regard to case but is ordered by branchcode instead of branch name (ALB, APL, COV, CPL, GPL, NPL, PPL, and goodwin in the example screenshot).
Comment 7 Owen Leonard 2011-02-24 21:19:30 UTC
Created attachment 3216 [details]
Branch sort on patron entry screen still incorrect
Comment 8 Nadia Nicolaides 2012-12-19 18:57:20 UTC Comment hidden (obsolete)
Comment 9 Chris Cormack 2012-12-19 19:16:35 UTC Comment hidden (obsolete)
Comment 10 Jonathan Druart 2012-12-21 11:04:57 UTC
QA Comments:

The odications in C4/Branch.pm are just in order to not use the default variable ($_).
On the login page we call the GetBranchesLoop routine.

Marked as Passed QA.
Comment 11 Jonathan Druart 2012-12-21 11:05:22 UTC
Created attachment 14220 [details] [review]
Follow-up Bug 5634: Ordering branches should be case independent

This patch fix the order of branches in the log-in page,
on Branch.pm we added the variable branchcode to the
hash returned by GetBranchesLoop, and this function is used
on Auth.pm to get a list of branches ordered by branchname

To test
1) Use an installation with some branches
2) On login screen the branches are ordered by branchcode
3) apply the patch
4) On login screen the branches are now ordered by branchname

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
This patch works as expected. Before applying the patch the branches
with lower case was at the end of the list. Now they are well ordered.
Comment 12 Jared Camins-Esakov 2012-12-21 12:45:34 UTC
This patch has been pushed to master.
Comment 13 Bernardo Gonzalez Kriegel 2013-01-09 18:50:35 UTC Comment hidden (obsolete)
Comment 14 Jonathan Druart 2013-01-23 08:10:10 UTC
Hi Bernardo,

Could you create a new bug and submit your patch in it please?
Since this patch has been pushed to master, all new followups must be proposed in a new bug.

Thanks.
Comment 15 Bernardo Gonzalez Kriegel 2013-01-23 08:39:46 UTC
Ok, no problem for me.
A new bug is cleaner, but this patch do not solve all cases.
So, have to be several patches and/or bugs.
Comment 16 Jonathan Druart 2013-01-23 09:18:47 UTC
Works on master
Comment 17 Jonathan Druart 2013-01-24 08:33:59 UTC
Patch submitted on bug 9457