From 3d9a68eb2846794e62a7fb711b1bc6d000d3cb4b Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 9 Jun 2015 21:51:44 -0400 Subject: [PATCH] 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 --- catalogue/search.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index 4d165ac..006a1d4 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -536,7 +536,7 @@ eval { # This sorts the facets into alphabetical order if ($facets) { foreach my $f (@$facets) { - $f->{facets} = [ sort { uc($a->{facet_title_value}) cmp uc($b->{facet_title_value}) } @{ $f->{facets} } ]; + $f->{facets} = [ sort { uc($a->{facet_label_value}) cmp uc($b->{facet_label_value}) } @{ $f->{facets} } ]; } } if ($@ || $error) { -- 1.9.1