Created attachment 143382 [details] [review] Bug 32127: Sort by description in Koha::Template::Plugin::Categories Like in Koha::Template::Plugin::Branches, methods in Koha::Template::Plugin::Categories must return categories sorted by description. Test plan : 1) Create a new patron category with code ZZZ and description AAAAAA 2) Go to patron search /cgi-bin/koha/members/members-home.pl 3) Look at filter by category : => Without patch the value AAAAAA is last => With patch the value AAAAAA is first 4) Click on 'New patron' => Without patch the value AAAAAA is last => With patch the value AAAAAA is first
Created attachment 143391 [details] [review] Bug 32127: Sort by description in Koha::Template::Plugin::Categories Like in Koha::Template::Plugin::Branches, methods in Koha::Template::Plugin::Categories must return categories sorted by description. Test plan : 1) Create a new patron category with code ZZZ and description AAAAAA 2) Go to patron search /cgi-bin/koha/members/members-home.pl 3) Look at filter by category : => Without patch the value AAAAAA is last => With patch the value AAAAAA is first 4) Click on 'New patron' => Without patch the value AAAAAA is last => With patch the value AAAAAA is first Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 143815 [details] [review] Bug 32127: Sort by description in Koha::Template::Plugin::Categories Like in Koha::Template::Plugin::Branches, methods in Koha::Template::Plugin::Categories must return categories sorted by description. Test plan : 1) Create a new patron category with code ZZZ and description AAAAAA 2) Go to patron search /cgi-bin/koha/members/members-home.pl 3) Look at filter by category : => Without patch the value AAAAAA is last => With patch the value AAAAAA is first 4) Click on 'New patron' => Without patch the value AAAAAA is last => With patch the value AAAAAA is first Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Good catch!
Makes sense, needs regression tests though.
Indeed. I've tried to add in t/db_dependent/Template/Plugin/Categories.t. But I don't know how to manage the existing categories. Any help is welcome :D
Created attachment 148890 [details] [review] Bug 32127: Add unit test Run prove t/db_dependent/Template/Plugin/Categories.t
Created attachment 148891 [details] [review] Bug 32127: Sort by description in Koha::Template::Plugin::Categories Like in Koha::Template::Plugin::Branches, methods in Koha::Template::Plugin::Categories must return categories sorted by description. Test plan : 1) Create a new patron category with code ZZZ and description AAAAAA 2) Go to patron search /cgi-bin/koha/members/members-home.pl 3) Look at filter by category : => Without patch the value AAAAAA is last => With patch the value AAAAAA is first 4) Click on 'New patron' => Without patch the value AAAAAA is last => With patch the value AAAAAA is first Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 148892 [details] [review] Bug 32127: Add unit test Run prove t/db_dependent/Template/Plugin/Categories.t
This works and tests pass. On /cgi-bin/koha/members/members-home.pl the dropdown sorts by description. If you click 'New patron', it sorts by description. If you are in '/members/memberentry.pl' and click the dropdown for 'Category:' it still sorts by code. I will sign-off here and we can address that in separate bug.
Created attachment 149099 [details] [review] Bug 32127: Sort by description in Koha::Template::Plugin::Categories Like in Koha::Template::Plugin::Branches, methods in Koha::Template::Plugin::Categories must return categories sorted by description. Test plan : 1) Create a new patron category with code ZZZ and description AAAAAA 2) Go to patron search /cgi-bin/koha/members/members-home.pl 3) Look at filter by category : => Without patch the value AAAAAA is last => With patch the value AAAAAA is first 4) Click on 'New patron' => Without patch the value AAAAAA is last => With patch the value AAAAAA is first Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Created attachment 149100 [details] [review] Bug 32127: Add unit test Run prove t/db_dependent/Template/Plugin/Categories.t Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Created attachment 149364 [details] [review] Bug 32127: Sort by description in Koha::Template::Plugin::Categories Like in Koha::Template::Plugin::Branches, methods in Koha::Template::Plugin::Categories must return categories sorted by description. Test plan : 1) Create a new patron category with code ZZZ and description AAAAAA 2) Go to patron search /cgi-bin/koha/members/members-home.pl 3) Look at filter by category : => Without patch the value AAAAAA is last => With patch the value AAAAAA is first 4) Click on 'New patron' => Without patch the value AAAAAA is last => With patch the value AAAAAA is first Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 149365 [details] [review] Bug 32127: Add unit test Run prove t/db_dependent/Template/Plugin/Categories.t Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work everyone! Pushed to stable for 22.11.x
Backported to 22.05.x for upcoming 22.05.13
conflicts on 21.11. can't backport.