Skip to content

Commit

Permalink
Merge pull request #70 from AlexanderBlanchardAC/24.07.00_summon_face…
Browse files Browse the repository at this point in the history
…t_uncheck_fix

fix: adjust code for facets to allow them to be unchecked
  • Loading branch information
Jacobomara901 authored Jun 11, 2024
2 parents f8223de + 8f9492a commit 2f2aa6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions code/web/release_notes/24.07.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
// katherine

// alexander
### Summon Updates
- Adjustments to code in Summon getFacetSet function to correct a bug. Individual facet filters can now be unchecked and the filter unset by clicking the checkbox. (*AB*)

// jacob

Expand Down
4 changes: 2 additions & 2 deletions code/web/sys/SearchObject/SummonSearcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,15 +486,15 @@ public function getFacetSet() {
foreach ($facetField['counts'] as $value) {
$facetValue = $value['value'];
//Ensures selected facet stays checked when selected - interacts with .tpl
$isApplied = array_key_exists($facetId, $this->filterList) && in_array($value, $this->filterList[$facetId]);
$isApplied = array_key_exists($facetId, $this->filterList) && in_array($facetValue, $this->filterList[$facetId]);
$facetSettings = [
'value' => $facetValue,
'display' =>$facetValue,
'count' =>$value['count'],
'isApplied' => $value['isApplied'],
];
if ($isApplied) {
$facetSettings['removalUrl'] = $this->renderLinkWithoutFilter($facetId . ':' . $value);
$facetSettings['removalUrl'] = $this->renderLinkWithoutFilter($facetId . ':' . $facetValue);
} else {
$facetSettings['url'] = $this->renderSearchUrl() . '&filter[]=' . $facetId . ':' . urlencode($facetValue);
}
Expand Down

0 comments on commit 2f2aa6f

Please sign in to comment.