Skip to content
Snippets Groups Projects
Commit 127990e4 authored by Demian Katz's avatar Demian Katz
Browse files

Merge pull request #259 from EreMaijala/hierarchical-facet-fix

Made hierarchicalFacetHelper optional in the constructor of SideFacets. ...
parents d3810592 f5c4d113
No related merge requests found
......@@ -121,7 +121,7 @@ class SideFacets extends AbstractFacets
*/
public function __construct(
\VuFind\Config\PluginManager $configLoader,
HierarchicalFacetHelper $facetHelper
HierarchicalFacetHelper $facetHelper = null
) {
$this->configLoader = $configLoader;
$this->hierarchicalFacetHelper = $facetHelper;
......@@ -232,6 +232,7 @@ class SideFacets extends AbstractFacets
* Get facet information from the search results.
*
* @return array
* @throws \Exception
*/
public function getFacetSet()
{
......@@ -239,6 +240,12 @@ class SideFacets extends AbstractFacets
foreach ($this->hierarchicalFacets as $hierarchicalFacet) {
if (isset($facetSet[$hierarchicalFacet])) {
if (!$this->hierarchicalFacetHelper) {
throw new \Exception(
get_class($this). ': hierarchical facet helper unavailable'
);
}
$facetArray = $this->hierarchicalFacetHelper->buildFacetArray(
$hierarchicalFacet, $facetSet[$hierarchicalFacet]['list']
);
......
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