Bug 4943: Search history cookie size limit
[koha.git] / opac / opac-search.pl
index bf4e0db..a38d6f9 100755 (executable)
@@ -317,7 +317,7 @@ my @limits;
 @limits = split("\0",$params->{'limit'}) if $params->{'limit'};
 
 if($params->{'multibranchlimit'}) {
-push @limits, join(" or ", map { "branch: $_ "}  @{GetBranchesInCategory($params->{'multibranchlimit'})}) ;
+    push @limits, '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')';
 }
 
 my $available;
@@ -504,6 +504,7 @@ for (my $i=0;$i<@servers;$i++) {
                    $template->param(ShowOpacRecentSearchLink => 1);
                }
  
+            shift @recentSearches if (@recentSearches > 15);
                # Pushing the cookie back 
                $newsearchcookie = $cgi->cookie(
                                            -name => 'KohaOpacRecentSearches',
@@ -628,6 +629,7 @@ $template->param(
             total => $total,
             opacfacets => 1,
             facets_loop => $facets,
+           displayFacetCount=> C4::Context->preference('displayFacetCount')||0,
             scan => $scan,
             search_error => $error,
 );