Description
The Minh Luong
2022-01-21 13:48:53 UTC
Created attachment 129698 [details]
cam13844 - Groups of libraries displayed in alphabetical order
OPAC's "Groups of libraries field" is now displayed in alphabetical order.
Created attachment 129699 [details] 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, then 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. Everything here works perfect and now is consistent with the behavior on the staff client. Awesome! The only problem now is in the commit message which must start as: Bug 29922: You can see the QA tool says: Commit title does not start with 'Bug XXXXX: ' - b9e3fec7c3 Can that be fixed please? Created attachment 129737 [details] [review] 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. Created attachment 129738 [details] [review] 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. https://bugs.koha-community.org/show_bug.cgi?id=29922 Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Please have a look at https://wiki.koha-community.org/wiki/Commit_messages Created attachment 130767 [details] [review] 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. https://bugs.koha-community.org/show_bug.cgi?id=29922 Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 131343 [details] [review] 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 <lucas@bywatersolutions.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> This doesn't work quite right for diacritics and umlauts. Ä or À will always sort to the bottom (after something starting with Z). Google suggests that this can be fixed by use locale - but I have to admit I am not sure where you'd add that and about the consequences. As this might also be an issue for French, it might be worth investigating a bit more. But it looks like this might be kind of a global issue :( I notice that sorting tables also puts the Ä at the bottom. So ready to pass QA on this being an improvement. I wonder if this could also be down to a server setting for locale (so might only be an issue in my dev env?) If someone could shed some light it would be nice! Created attachment 131444 [details] [review] Bug 29922: Sorting works for accents 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. Thx a lot for your work on this! I am a little worried about hardcoding the fr_CA with this solution. Then I remembered we had a similar problem somewhere else and the solution found there is a little simpler, but appears to also work nicely in my tests: Bug 29946 - Sort profiles alphabetically when staging MARC records for import Could you have a look please? Created attachment 136612 [details] [review] Bug 29922: Make get_search_groups return results sorted by title get_search_groups from Koha/Library/Groups.pm returns library groups sorted by title. Test plan: 1- Go to administration > library groups and create multiple library groups with different names (e.g. AGroup, BGroup, ÄGroup, etc.). Make sure to tick "Use for OPAC search groups" checkbox. 2- Go to advanced search in OPAC. 3- Under "Groups of librairies" , click the select button. 4- Notice that the library groups are not in alphabetical order. 5- Apply the patch. 6- Notice that the library groups are in alphabetical order. 7- Run `prove t/db_dependent/LibraryGroups.t` and all test should pass. Created attachment 137045 [details] [review] Bug 29922: Make get_search_groups return results sorted by title get_search_groups from Koha/Library/Groups.pm returns library groups sorted by title. Test plan: 1- Go to administration > library groups and create multiple library groups with different names (e.g. AGroup, BGroup, ÄGroup, etc.). Make sure to tick "Use for OPAC search groups" checkbox. 2- Go to advanced search in OPAC. 3- Under "Groups of librairies" , click the select button. 4- Notice that the library groups are not in alphabetical order. 5- Apply the patch. 6- Notice that the library groups are in alphabetical order. 7- Run `prove t/db_dependent/LibraryGroups.t` and all test should pass. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> The sorting is now correct in the OPAC, but still wrong in the staff interface. We could make file a separate bug for the staff interface or we could add a follow-up here and adjust the bug description. Created attachment 137063 [details] [review] Bug 29922: (follow-up) Remove extra sort Created attachment 137064 [details] [review] Bug 29922: (follow-up) Remove extra sort Remove wrong sort in staff advanced search page It should now sort properly in the staff interface. Created attachment 137325 [details] [review] Bug 29922: Make get_search_groups return results sorted by title get_search_groups from Koha/Library/Groups.pm returns library groups sorted by title. Test plan: 1- Go to administration > library groups and create multiple library groups with different names (e.g. AGroup, BGroup, ÄGroup, etc.). Make sure to tick "Use for OPAC search groups" checkbox. 2- Go to advanced search in OPAC. 3- Under "Groups of librairies" , click the select button. 4- Notice that the library groups are not in alphabetical order. 5- Apply the patch. 6- Notice that the library groups are in alphabetical order. 7- Run `prove t/db_dependent/LibraryGroups.t` and all test should pass. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: David Nind <david@davidnind.com> Created attachment 137326 [details] [review] Bug 29922: (follow-up) Remove extra sort Remove wrong sort in staff advanced search page Signed-off-by: David Nind <david@davidnind.com> Created attachment 137405 [details] [review] Bug 29922: Make get_search_groups return results sorted by title get_search_groups from Koha/Library/Groups.pm returns library groups sorted by title. Test plan: 1- Go to administration > library groups and create multiple library groups with different names (e.g. AGroup, BGroup, ÄGroup, etc.). Make sure to tick "Use for OPAC search groups" checkbox. 2- Go to advanced search in OPAC. 3- Under "Groups of librairies" , click the select button. 4- Notice that the library groups are not in alphabetical order. 5- Apply the patch. 6- Notice that the library groups are in alphabetical order. 7- Run `prove t/db_dependent/LibraryGroups.t` and all test should pass. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Created attachment 137406 [details] [review] Bug 29922: (follow-up) Remove extra sort Remove wrong sort in staff advanced search page Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Happy to see this one finished, thanks your for your perseverance! Pushed to master for 22.11. Nice work everyone, thanks! Backported to 22.05.x for 22.05.05 thx pushed to 21.11.x for 21.11.12 Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. Nothing to document, marking resolved. |