Skip to content
Snippets Groups Projects
Commit c1419571 authored by Demian Katz's avatar Demian Katz
Browse files

Fix bug: facets not filtered correctly.

parent 00bd97ee
No related merge requests found
...@@ -80,6 +80,12 @@ class Results extends \VuFind\Search\Base\Results ...@@ -80,6 +80,12 @@ class Results extends \VuFind\Search\Base\Results
*/ */
public function getFacetList($filter = null) public function getFacetList($filter = null)
{ {
// If there is no filter, we'll use all facets as the filter:
if (null === $filter) {
$filter = $this->getParams()->getFacetConfig();
}
$filterFields = array_keys($filter);
// Loop through the facets returned by EDS // Loop through the facets returned by EDS
$facetResult = []; $facetResult = [];
if (is_array($this->responseFacets)) { if (is_array($this->responseFacets)) {
...@@ -92,6 +98,11 @@ class Results extends \VuFind\Search\Base\Results ...@@ -92,6 +98,11 @@ class Results extends \VuFind\Search\Base\Results
// different value for actual display! // different value for actual display!
$field = $current['displayName']; $field = $current['displayName'];
// If we are filtering out the field, skip it!
if (!in_array($field, $filterFields)) {
continue;
}
// Should we translate values for the current facet? // Should we translate values for the current facet?
if ($translate = in_array($field, $translatedFacets)) { if ($translate = in_array($field, $translatedFacets)) {
$transTextDomain = $this->getOptions() $transTextDomain = $this->getOptions()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment