Bug 12478: (follow-up) Display the correct number of facets

This patch fixes a side-effect of the previous "Display the correct
number of facets (5 instead of 6)" patch.

If you ask for more facets ('show more' link) and that the number of
facets is > 5 but < 10, 1 facet will be missing.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2015-10-05 10:58:50 +01:00 committed by Brendan Gallagher
parent 282ea1cdb4
commit c5f351360f

View file

@ -416,7 +416,7 @@ sub _convert_facets {
"type_label_$type_to_label{$type}" => 1,
type_link_value => $type,
};
$limit = $#{ $data->{terms} } if ( $limit > @{ $data->{terms} } );
$limit = @{ $data->{terms} } if ( $limit > @{ $data->{terms} } );
foreach my $term ( @{ $data->{terms} }[ 0 .. $limit - 1 ] ) {
my $t = $term->{term};
my $c = $term->{count};