Bug 14371 - Facets should be sorted by label (displayed) not title (link value)
Summary: Facets should be sorted by label (displayed) not title (link value)
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-10 01:50 UTC by Nick Clemens
Modified: 2016-12-05 21:23 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 14371 - Facets should be sorted by label (displayed) not title (link value) (1.42 KB, patch)
2015-06-10 02:00 UTC, Nick Clemens
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 14371 - Facets should be sorted by label (displayed) not title (link value) (1.53 KB, patch)
2015-06-18 15:06 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 14371 - Facets should be sorted by label (displayed) not title (link value) (2.18 KB, patch)
2015-06-18 17:22 UTC, Nick Clemens
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 14371 - Facets should be sorted by label (displayed) not title (link value) (2.20 KB, patch)
2015-06-19 14:21 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 14371 - Facets should be sorted by label (displayed) not title (link value) (2.25 KB, patch)
2015-06-19 14:34 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2015-06-10 01:50:05 UTC
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
Comment 1 Nick Clemens 2015-06-10 02:00:16 UTC Comment hidden (obsolete)
Comment 2 Bernardo Gonzalez Kriegel 2015-06-18 15:06:37 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2015-06-18 15:52:50 UTC
This change should also done at the OPAC.
Comment 4 Jonathan Druart 2015-06-18 15:53:08 UTC
*be*
Comment 5 Nick Clemens 2015-06-18 17:22:40 UTC Comment hidden (obsolete)
Comment 6 Bernardo Gonzalez Kriegel 2015-06-19 14:21:28 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2015-06-19 14:34:07 UTC
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>
Comment 8 Tomás Cohen Arazi 2015-06-22 14:55:40 UTC
Patch pushed to master.

Thanks Nick!
Comment 9 Chris Cormack 2015-07-09 21:09:36 UTC
Pushed to 3.20.x will be in 3.20.2