From 1efca9ebeb4ab68d0202cc68ed30b1973e418900 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Mon, 6 Apr 2020 07:52:55 -0400
Subject: [PATCH] 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.

---
 module/VuFind/src/VuFind/Search/EDS/Params.php | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/module/VuFind/src/VuFind/Search/EDS/Params.php b/module/VuFind/src/VuFind/Search/EDS/Params.php
index 1da9eadc4a8..417d77de144 100644
--- a/module/VuFind/src/VuFind/Search/EDS/Params.php
+++ b/module/VuFind/src/VuFind/Search/EDS/Params.php
@@ -167,6 +167,7 @@ class Params extends \VuFind\Search\Base\Params
     {
         // Which filters should be applied to our query?
         $filterList = $this->getFilterList();
+        $hiddenFilterList = $this->getHiddenFilters();
         if (!empty($filterList)) {
             // Loop through all filters and add appropriate values to request:
             foreach ($filterList as $filterArray) {
@@ -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);
+                }
+            }
+        }
     }
 
     /**
-- 
GitLab