From 4b7f4e8916657e553a77b825fb2e88be175a1a2e Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 19 Feb 2014 15:26:24 -0500 Subject: [PATCH] Bug 11796: fix display of search result facets if facet happens to have exactly six entries If a search gives results with 6 facets, one of those facets won't be displayed. This is due to a bug in the code that only considers great than 6 facets in one area, and less than 6 in another. Test Plan: 1) Perform a search that should give results for 6 different libraries 2) Note you only see 5 libraries in the facets with no option to expand 3) Apply this patch 4) Repeat step 1 5) Note you now have the option to expand the facets list Signed-off-by: Chris Cormack Signed-off-by: Jonathan Druart This patch should provide a regression test but I really don't know how to write it. Signed-off-by: Galen Charlton (cherry picked from commit e7286e05137276f0a916f06d60a13c22c93294b2) Signed-off-by: Fridolin Somers Signed-off-by: Kyle M Hall (cherry picked from commit dc842baa70e5dcf232f15cff232409fdcd833014) --- C4/Search.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index cecfd50fee..dc91a2d9d1 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -568,7 +568,7 @@ sub getRecords { ) { $number_of_facets++; - if ( ( $number_of_facets < 6 ) + if ( ( $number_of_facets <= 5 ) || ( $expanded_facet eq $link_value ) || ( $facets_info->{$link_value}->{'expanded'} ) ) @@ -645,7 +645,7 @@ sub getRecords { # handle expanded option unless ( $facets_info->{$link_value}->{'expanded'} ) { $expandable = 1 - if ( ( $number_of_facets > 6 ) + if ( ( $number_of_facets > 5 ) && ( $expanded_facet ne $link_value ) ); } push @facets_loop, -- 2.20.1