diff --git a/src/module-elasticsuite-catalog/Block/Navigation.php b/src/module-elasticsuite-catalog/Block/Navigation.php index 5c89baf51..ca044bcce 100644 --- a/src/module-elasticsuite-catalog/Block/Navigation.php +++ b/src/module-elasticsuite-catalog/Block/Navigation.php @@ -116,8 +116,12 @@ public function getActiveFilters() $requestParams = array_keys($this->getRequest()->getParams()); $displayedFilters = $this->getDisplayedFilters(); $expandedFacets = $this->_scopeConfig->getValue(self::DEFAULT_EXPANDED_FACETS_COUNT_CONFIG_XML_PATH); - $activeFilters = range(0, min(count($displayedFilters), $expandedFacets) - 1); - + $activeFilters = []; + + if ($expandedFacets > 0) { + $activeFilters = range(0, min(count($displayedFilters), $expandedFacets) - 1); + } + foreach ($displayedFilters as $index => $filter) { if (in_array($filter->getRequestVar(), $requestParams)) { $activeFilters[] = $index;