diff --git a/config/vufind/EDS.ini b/config/vufind/EDS.ini index 7edd57c981cad338632b2fa0231a4b89c351544a..0f98a8b23cff5b96ef9d717c5da0aa9e68443e3b 100644 --- a/config/vufind/EDS.ini +++ b/config/vufind/EDS.ini @@ -122,7 +122,9 @@ labelSections[] = Facets ; This setting lists configuration settings defining checkbox facets. If you use ; a custom section to configure additional facets, be sure to add it to this list -; so labels display correctly in history, the advanced search editor, etc. +; so labels display correctly in history, the advanced search editor, etc. If you +; are using the reverse label => filter format rather than filter => label, you +; should prefix the section name with a ~ character to ensure proper loading. checkboxSections[] = CheckboxFacets ; Facet display settings @@ -229,14 +231,14 @@ organization_id = "VuFind 2.x from MyUniversity" [List] view=full -; This section controls the behavior of the Autocomplete of EDS +; This section controls the behavior of the Autocomplete of EDS ; If enabled the option "autocomplete" is send for UIDAuth to get the token -; and the url. +; and the url. [Autocomplete] ; Set this to false to disable all autocomplete behavior enabled = true -; Define a default_handler +; Define a default_handler default_handler = Eds ; Auto-submit autocomplete on click or enter @@ -247,7 +249,7 @@ auto_submit = true ; behavior when that search type is selected. (default: Eds:rawqueries) ; These values are available: None, Eds:rawqueries and Eds:holdings ; Use None to disable autocomplete for a specific search type -; Use Eds:holdings for title completion in PubFinder. +; Use Eds:holdings for title completion in PubFinder. ; Use Eds:rawqueries for completion of basic textual queries. [Autocomplete_Types] ;AllFields = Eds:rawqueries diff --git a/config/vufind/Primo.ini b/config/vufind/Primo.ini index 6823989cbd40cc0fd04c415605783b92602361d7..5d662f863d914a2b5e97098ec9c11e783608a74a 100644 --- a/config/vufind/Primo.ini +++ b/config/vufind/Primo.ini @@ -108,7 +108,9 @@ labelSections[] = Facets ; This setting lists configuration settings defining checkbox facets. If you use ; a custom section to configure additional facets, be sure to add it to this list -; so labels display correctly in history, the advanced search editor, etc. +; so labels display correctly in history, the advanced search editor, etc. If you +; are using the reverse label => filter format rather than filter => label, you +; should prefix the section name with a ~ character to ensure proper loading. checkboxSections[] = CheckboxFacets ; Checkbox facets are facets, which are getting displayed as checkboxes diff --git a/config/vufind/Summon.ini b/config/vufind/Summon.ini index 26d25143dfb695b6afd4034bcc7d7a024dbd4db7..d703c0e8224a68dd06ddc1a67161f6689643e2e5 100644 --- a/config/vufind/Summon.ini +++ b/config/vufind/Summon.ini @@ -164,7 +164,9 @@ labelSections[] = Facets ; This setting lists configuration settings defining checkbox facets. If you use ; a custom section to configure additional facets, be sure to add it to this list -; so labels display correctly in history, the advanced search editor, etc. +; so labels display correctly in history, the advanced search editor, etc. If you +; are using the reverse label => filter format rather than filter => label, you +; should prefix the section name with a ~ character to ensure proper loading. checkboxSections[] = CheckboxFacets ; Facet display settings diff --git a/config/vufind/facets.ini b/config/vufind/facets.ini index e3c1492f9bf215aeda715f65c98b592d40f6aa8a..4dae529e5c8cd187dd88f9f090491fd318c80ad6 100644 --- a/config/vufind/facets.ini +++ b/config/vufind/facets.ini @@ -39,7 +39,9 @@ labelSections[] = ExtraFacetLabels ; This setting lists configuration settings defining checkbox facets. If you use ; a custom section to configure additional facets, be sure to add it to this list -; so labels display correctly in history, the advanced search editor, etc. +; so labels display correctly in history, the advanced search editor, etc. If you +; are using the reverse label => filter format rather than filter => label, you +; should prefix the section name with a ~ character to ensure proper loading. checkboxSections[] = CheckboxFacets ; This section is used to specify labels for facets that may be applied by parts diff --git a/module/VuFind/src/VuFind/Search/Base/Params.php b/module/VuFind/src/VuFind/Search/Base/Params.php index 8c848b6265403afc7b0b92baaa40e74d0cf8f7c3..502f88d6b845d491ad144d4ef9bcfb436b36d174 100644 --- a/module/VuFind/src/VuFind/Search/Base/Params.php +++ b/module/VuFind/src/VuFind/Search/Base/Params.php @@ -1797,11 +1797,19 @@ class Params ) { $config = $this->configLoader ->get($cfgFile ?? $this->getOptions()->getFacetsIni()); - if (empty($config->$facetList)) { - return false; - } - foreach ($config->$facetList as $key => $value) { - $this->addCheckboxFacet($key, $value); + $retVal = false; + // If the section is in reverse order, the tilde will flag this: + if (substr($facetList, 0, 1) == '~') { + foreach ($config->{substr($facetList, 1)} as $value => $key) { + $this->addCheckboxFacet($key, $value); + $retVal = true; + } + } else { + foreach ($config->$facetList as $key => $value) { + $this->addCheckboxFacet($key, $value); + $retVal = true; + } } + return $retVal; } }