Bugzilla – Attachment 40381 Details for
Bug 14371
Facets should be sorted by label (displayed) not title (link value)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 14371 - Facets should be sorted by label (displayed) not title (link value)
SIGNED-OFF-Bug-14371---Facets-should-be-sorted-by-.patch (text/plain), 2.20 KB, created by
Bernardo Gonzalez Kriegel
on 2015-06-19 14:21:28 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 14371 - Facets should be sorted by label (displayed) not title (link value)
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2015-06-19 14:21:28 UTC
Size:
2.20 KB
patch
obsolete
>From d07ab5d161b8f32cad43039e9c98d2b0b9d200d8 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@quecheelibrary.org> >Date: Tue, 9 Jun 2015 21:51:44 -0400 >Subject: [PATCH] [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 >--- > catalogue/search.pl | 2 +- > opac/opac-search.pl | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >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) { >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 2c4e34e..81f2bbb 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -579,7 +579,7 @@ if ($tag) { > # 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} } ]; > } > @$facets = sort {$a->{expand} cmp $b->{expand}} @$facets; > } >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14371
:
40054
|
40314
|
40324
|
40381
|
40382