From f967ae22d8b81805e8791d3a6364e7abecf88b8b Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Fri, 11 Jun 2021 13:35:41 +0200 Subject: [PATCH] Bug 28554: In Koha::AuthorisedValues sort by description In itemsearch form, there are several filters build with authorized values. There values should be sorted by description. Test plan : 1) Create several values and descriptions in authorized values LOC 2) Go to itemsearch 3) See filter by location sorts on description and not on value Seems change in search_by_marc_field can not be tested in interface Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit ee27af1cd97b2d7188867cfe0fc77c0f90aff1c8) Signed-off-by: Fridolin Somers --- Koha/AuthorisedValues.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Koha/AuthorisedValues.pm b/Koha/AuthorisedValues.pm index a4916d571e..e9f25b861c 100644 --- a/Koha/AuthorisedValues.pm +++ b/Koha/AuthorisedValues.pm @@ -79,7 +79,10 @@ sub search_by_marc_field { ( defined $tagfield ? ( 'marc_subfield_structures.tagfield' => $tagfield ) : () ), ( defined $tagsubfield ? ( 'marc_subfield_structures.tagsubfield' => $tagsubfield ) : () ), }, - { join => { category => 'marc_subfield_structures' } } + { + join => { category => 'marc_subfield_structures' }, + order_by => [ 'category', 'lib', 'lib_opac' ], + } ); } @@ -98,6 +101,7 @@ sub search_by_koha_field { }, { join => { category => 'marc_subfield_structures' }, distinct => 1, + order_by => [ 'category', 'lib', 'lib_opac' ], } ); } -- 2.39.5