Skip to content
Snippets Groups Projects
Commit 1efca9eb authored by Demian Katz's avatar Demian Katz Committed by Robert Lange
Browse files

Support hidden filters in EDS.

- This makes the [SearchTabsFilters] mechanism in config.ini work with EDS; further effort would be needed to add global hidden filter support similar to that found in searches.ini.
parent 56cc4458
No related merge requests found
...@@ -167,6 +167,7 @@ class Params extends \VuFind\Search\Base\Params ...@@ -167,6 +167,7 @@ class Params extends \VuFind\Search\Base\Params
{ {
// Which filters should be applied to our query? // Which filters should be applied to our query?
$filterList = $this->getFilterList(); $filterList = $this->getFilterList();
$hiddenFilterList = $this->getHiddenFilters();
if (!empty($filterList)) { if (!empty($filterList)) {
// Loop through all filters and add appropriate values to request: // Loop through all filters and add appropriate values to request:
foreach ($filterList as $filterArray) { foreach ($filterList as $filterArray) {
...@@ -180,6 +181,18 @@ class Params extends \VuFind\Search\Base\Params ...@@ -180,6 +181,18 @@ class Params extends \VuFind\Search\Base\Params
} }
} }
} }
if (!empty($hiddenFilterList)) {
foreach ($hiddenFilterList as $field => $hiddenFilters) {
foreach ($hiddenFilters as $value) {
$safeValue = SearchRequestModel::escapeSpecialCharacters(
$value
);
// Standard case:
$hfq = "{$field}:{$safeValue}";
$params->add('filters', $hfq);
}
}
}
} }
/** /**
......
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