Skip to content

Commit

Permalink
Hotfix toggle characters
Browse files Browse the repository at this point in the history
  • Loading branch information
zonky2 committed Sep 1, 2020
2 parents bbeecf1 + 5ebacfe commit cef0b95
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/FilterSetting/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,23 @@ public function enableFEFilterWidget()
*/
protected function isActiveFrontendFilterValue($arrWidget, $arrFilterUrl, $strKeyOption)
{
return \in_array($strKeyOption, (array) $arrWidget['value']) ? true : false;
return \in_array($strKeyOption, \explode(',', $arrWidget['value'])) ? true : false;
}

/**
* {@inheritdoc}
*/
protected function getFrontendFilterValue($arrWidget, $arrFilterUrl, $strKeyOption)
{
$arrCurrent = (array) $arrWidget['value'];
// toggle if active.
$arrCurrent = \explode(',', $arrWidget['value']);

// Toggle if active.
if ($this->isActiveFrontendFilterValue($arrWidget, $arrFilterUrl, $strKeyOption)) {
$arrCurrent = \array_diff($arrCurrent, [$strKeyOption]);
} else {
$arrCurrent[] = $strKeyOption;
}

return \implode(',', $arrCurrent);
}

Expand Down

0 comments on commit cef0b95

Please sign in to comment.