Skip to content

Commit

Permalink
[VUFIND-1622] Fix EDS date range facet display. (vufind-org#2970)
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz authored Jun 30, 2023
1 parent 8ff0111 commit 4168f45
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions module/VuFind/src/VuFind/Search/EDS/Results.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,14 @@ protected function performSearch()
$this->responseFacets = $collection->getFacets();
$this->resultTotal = $collection->getTotal();

// Add a publication date facet
$this->responseFacets[] = [
'fieldName' => 'PublicationDate',
'displayName' => 'PublicationDate',
'displayText' => 'Publication Date',
'counts' => [],
];
// Add fake date facets if flagged earlier; this is necessary in order
// to display the date range facet control in the interface.
$dateFacets = $this->getParams()->getDateFacetSettings();
if (!empty($dateFacets)) {
foreach ($dateFacets as $dateFacet) {
$this->responseFacets[$dateFacet] = [""];
}
}

// Construct record drivers for all the items in the response:
$this->results = $collection->getRecords();
Expand Down

0 comments on commit 4168f45

Please sign in to comment.