Bug 5634

Summary: Ordering branches should be case independent
Product: Koha Reporter: Paul Poulain <paul.poulain>
Component: System AdministrationAssignee: Paul Poulain <paul.poulain>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: enhancement    
Priority: P5 - low CC: bgkriegel, chris, gmcharlt, jonathan.druart, nengard
Version: master   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9457
Change sponsored?: Sponsored Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: patch
Screenshot of incorrect sort
Screenshot of correct sort
Branch order on login page still incorrect
Branch sort on patron entry screen still incorrect
Follow-up Bug 5634: Ordering branches should be case independent
Follow-up Bug 5634: Ordering branches should be case independent
Follow-up Bug 5634: Ordering branches should be case independent
Bug 5634 - Followup - Ordering branches should be case independent

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