For facets like Branches, Item Types, and Locations if the code/display differ in alphabetical sort values you get results that are out of order to the user. To reproduce: Pick two libraries e.g. Centerville(CPL) and Fairfield (FFL) Perform a search with results in each branch and see that Branch facets appear correctly sorted Rename Centerville as Zebra and Fairfield as Aardvark Repeat search and see that Branch facets are incorrectly sorted
Created attachment 40054 [details] [review] Bug 14371 - Facets should be sorted by label (displayed) not title (link value) This patch changes one small line in search.pl to sort facets by: facet_label_value instead of facet_title_value To test: 1 - Perform a search with results in two branches e.g. Centerville (code CPL) and Fairfield (code FPL) 2 - Notice that branch facets appear correctly sorted 3 - Rename the branches Centervile->Zebra and Fairfeild->Aardvark (but don't change codes) 4 - Repeat original search 5 - Note that branch facets are no longer correctly sorted 6 - Apply patch 7 - Repeat search 8 - Facets should be correctly sorted 9 - Ensure there are no unintended consequences/regressions
Created attachment 40314 [details] [review] [SIGNED-OFF] Bug 14371 - Facets should be sorted by label (displayed) not title (link value) This patch changes one small line in search.pl to sort facets by: facet_label_value instead of facet_title_value To test: 1 - Perform a search with results in two branches e.g. Centerville (code CPL) and Fairfield (code FPL) 2 - Notice that branch facets appear correctly sorted 3 - Rename the branches Centervile->Zebra and Fairfeild->Aardvark (but don't change codes) 4 - Repeat original search 5 - Note that branch facets are no longer correctly sorted 6 - Apply patch 7 - Repeat search 8 - Facets should be correctly sorted 9 - Ensure there are no unintended consequences/regressions Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Work as described, no errors
This change should also done at the OPAC.
*be*
Created attachment 40324 [details] [review] Bug 14371 - Facets should be sorted by label (displayed) not title (link value) This patch changes one small line in catalogue/search.pl and opac/opac-search to sort facets by: facet_label_value instead of facet_title_value To test: 1 - Perform a search with results in two branches e.g. Centerville (code CPL) and Fairfield (code FPL) 2 - Notice that branch facets appear correctly sorted 3 - Rename the branches Centervile->Zebra and Fairfeild->Aardvark (but don't change codes) 4 - Repeat original search 5 - Note that branch facets are no longer correctly sorted 6 - Apply patch 7 - Repeat search 8 - Facets should be correctly sorted 9 - Test in both staff and opac search 10 - Ensure there are no unintended consequences/regressions
Created attachment 40381 [details] [review] [SIGNED-OFF] Bug 14371 - Facets should be sorted by label (displayed) not title (link value) This patch changes one small line in catalogue/search.pl and opac/opac-search to sort facets by: facet_label_value instead of facet_title_value To test: 1 - Perform a search with results in two branches e.g. Centerville (code CPL) and Fairfield (code FPL) 2 - Notice that branch facets appear correctly sorted 3 - Rename the branches Centervile->Zebra and Fairfeild->Aardvark (but don't change codes) 4 - Repeat original search 5 - Note that branch facets are no longer correctly sorted 6 - Apply patch 7 - Repeat search 8 - Facets should be correctly sorted 9 - Test in both staff and opac search 10 - Ensure there are no unintended consequences/regressions Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Work as described, staff AND opac No errors
Created attachment 40382 [details] [review] Bug 14371 - Facets should be sorted by label (displayed) not title (link value) This patch changes one small line in catalogue/search.pl and opac/opac-search to sort facets by: facet_label_value instead of facet_title_value To test: 1 - Perform a search with results in two branches e.g. Centerville (code CPL) and Fairfield (code FPL) 2 - Notice that branch facets appear correctly sorted 3 - Rename the branches Centervile->Zebra and Fairfeild->Aardvark (but don't change codes) 4 - Repeat original search 5 - Note that branch facets are no longer correctly sorted 6 - Apply patch 7 - Repeat search 8 - Facets should be correctly sorted 9 - Test in both staff and opac search 10 - Ensure there are no unintended consequences/regressions Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Work as described, staff AND opac No errors Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Patch pushed to master. Thanks Nick!
Pushed to 3.20.x will be in 3.20.2