Bugzilla – Attachment 131444 Details for
Bug 29922
Group of libraries are now displayed in alphabetical order
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29922: Sorting works for accents
Bug-29922-Sorting-works-for-accents.patch (text/plain), 1.64 KB, created by
The Minh Luong
on 2022-03-07 16:40:53 UTC
(
hide
)
Description:
Bug 29922: Sorting works for accents
Filename:
MIME Type:
Creator:
The Minh Luong
Created:
2022-03-07 16:40:53 UTC
Size:
1.64 KB
patch
obsolete
>From 5f1eefa403f5c3c2ee2fd85dd9e9d09d6ccfd236 Mon Sep 17 00:00:00 2001 >From: The Minh Luong <theminh@inlibro.com> >Date: Mon, 7 Mar 2022 11:29:30 -0500 >Subject: [PATCH] Bug 29922: Sorting works for accents >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch sorts groups of libraries in alphabetical order, with the accents too. >I've used the setlocale() function to set the ordering for comparison (LC_COLLATE) to the one used in french language. > >TO TEST: >1. Follow the steps in the previous patch >NOTE: Have some groups of libraries that starts with accented letters (ex. ÃGroup, ÃGroup, ...) >2. Go in the OPAC, then Advanced search and click on the "Groups of libraries" dropdown. >3. Notice that the groups are sorted in alphabetical order. >NOTE: Accented groups are sorted too ! > >Although this patch can sort the groups as described, I have read that locale might not be available on all computers. >--- > opac/opac-search.pl | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 04cf839b27..ebf503fa04 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -216,8 +216,11 @@ if ($cgi->cookie("search_path_code")) { > } > } > >+use POSIX qw(locale_h); >+use locale; >+setlocale(LC_COLLATE, "fr_CA.UTF-8"); > my @search_groups = Koha::Library::Groups->get_search_groups( { interface => 'opac' } )->as_list; >-@search_groups = sort { $a->title cmp $b->title } @search_groups; >+@search_groups = sort { lc($a->title) cmp lc($b->title) } @search_groups; > $template->param( search_groups => \@search_groups ); > > # load the language limits (for search) >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29922
:
129698
|
129699
|
129737
|
129738
|
130767
|
131343
|
131444
|
136612
|
137045
|
137063
|
137064
|
137325
|
137326
|
137405
|
137406