Bug 14417 - Facet labels sorted incorrectly (OPAC) and inconsistently (OPAC vs Staff)
Summary: Facet labels sorted incorrectly (OPAC) and inconsistently (OPAC vs Staff)
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Galen Charlton
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-18 19:52 UTC by Nick Clemens
Modified: 2021-12-13 21:08 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2015-06-18 19:52:27 UTC
While working on Bug 14371 I noticed the line in opac-search.pl:
@$facets = sort {$a->{expand} cmp $b->{expand}} @$facets;

This seems to be intended to sort facets so that labels display in order in search results, however, it doesn't work. 

'expand' contains the facet index code (su-geo, itype, au, se ...) instead of the label value (Places, Item Types, Author, Series) so sorting doesn't work out ('Places' sorts after 'Series')

The actual labels are assigned by and IF statement in opac-facets.inc and are translatable so I think any sorting would have to be done post page creation (javascript?)

No sorting of any kind is applied in catalog/search.pl, so facet results between staff/opac don't match up.
Comment 1 Magnus Enger 2020-12-07 12:02:52 UTC
Is this fixed by bug 25701, or is the scope different?
Comment 2 Nick Clemens 2020-12-07 12:53:30 UTC
(In reply to Magnus Enger from comment #1)
> Is this fixed by bug 25701, or is the scope different?

I believe this is resolved