From 5366506065105f41b4c1ac6007c9a4dbf28be134 Mon Sep 17 00:00:00 2001 From: The Minh Luong Date: Fri, 21 Jan 2022 08:45:23 -0500 Subject: [PATCH] Bug 29922: Group of libraries are now displayed in alphabetical order This patch modifies the OPAC's "Group of libraries" field in Advanced search tab. When the select button under the text "Groups of libraries" is clicked, the library groups are now displayed in alphabetical orders. To test, start by creating multiple libraries (At least 5). Then, create library groups (At least 5) in non-alphabetical order. (Make sure "Use for OPAC search groups" is checked when creating a library group). - Example: CGroup,DGroup,AGroup,EGroup,BGroup (These are the Titles) From there, follow these steps: 1 - Go in OPAC, then Advanced search. 2 - Under "Groups of librairies" , click the select button. 3 - Notice that the library groups are not in alphabetical order. 4 - Apply the patch. 5 - Notice that the library groups are in alphabetical order. Signed-off-by: Lucas Gass Signed-off-by: Owen Leonard --- opac/opac-search.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/opac/opac-search.pl b/opac/opac-search.pl index b74fc0b562..04cf839b27 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -217,6 +217,7 @@ if ($cgi->cookie("search_path_code")) { } my @search_groups = Koha::Library::Groups->get_search_groups( { interface => 'opac' } )->as_list; +@search_groups = sort { $a->title cmp $b->title } @search_groups; $template->param( search_groups => \@search_groups ); # load the language limits (for search) -- 2.20.1