From a866ab9439cd89ea02dbf7b92ed9b079b45450d5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 28 Aug 2015 11:29:23 +0100 Subject: [PATCH] Bug 12478: Do not display the 'Show more' links if no more facet available Signed-off-by: Nick Clemens Signed-off-by: Jesse Weaver Signed-off-by: Tomas Cohen Arazi Signed-off-by: Kyle M Hall Signed-off-by: Brendan Gallagher --- Koha/SearchEngine/Elasticsearch/Search.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm index 1a74e95a98..5e7753b82a 100644 --- a/Koha/SearchEngine/Elasticsearch/Search.pm +++ b/Koha/SearchEngine/Elasticsearch/Search.pm @@ -408,7 +408,6 @@ sub _convert_facets { # We restrict to the most popular $limit results my $limit = ( $type eq $exp_facet ) ? 10 : 5; - $limit = $#{ $data->{terms} } if ( $limit > @{ $data->{terms} } ); my $facet = { type_id => $type . '_id', expand => $type, @@ -417,6 +416,7 @@ sub _convert_facets { "type_label_$type_to_label{$type}" => 1, type_link_value => $type, }; + $limit = $#{ $data->{terms} } if ( $limit > @{ $data->{terms} } ); foreach my $term ( @{ $data->{terms} }[ 0 .. $limit - 1 ] ) { my $t = $term->{term}; my $c = $term->{count}; -- 2.39.5