Skip to content
Snippets Groups Projects
Commit 66811470 authored by Ere Maijala's avatar Ere Maijala Committed by Demian Katz
Browse files

Fixed multiple accesses of undefined variables in the facet templates. (#969)

parent 73a7e327
No related merge requests found
......@@ -47,8 +47,14 @@
<? if (isset($rangeFacets[$title])): ?>
<?=$this->context($this)->renderInContext('Recommend/SideFacets/range-slider.phtml', ['title' => $title, 'facet' => $rangeFacets[$title]]); ?>
<? else: ?>
<? $contextVars = [
'allowExclude' => $this->recommend->excludeAllowed($title),
'title' => $title,
'sortOptions' => isset($hierarchicalFacetSortOptions[$title]) ? $hierarchicalFacetSortOptions[$title] : '',
'collapsedFacets' => $collapsedFacets
]; ?>
<? if (in_array($title, $hierarchicalFacets)): ?>
<?=$this->context($this)->renderInContext('Recommend/SideFacets/hierarchical-facet.phtml', ['title' => $title, 'sortOptions' => $hierarchicalFacetSortOptions[$title]]); ?>
<?=$this->context($this)->renderInContext('Recommend/SideFacets/hierarchical-facet.phtml', $contextVars); ?>
<noscript>
<? endif; ?>
<? $contextVars = [
......
<? $this->headScript()->appendFile('vendor/jsTree/jstree.min.js'); ?>
<? if (!in_array($this->title, $collapsedFacets)): ?>
<? if (!in_array($this->title, $this->collapsedFacets)): ?>
<?
$script = <<<JS
$(document).ready(function() {
......@@ -21,7 +21,7 @@ JS;
<li id="facet_<?=$this->escapeHtml($this->title)?>" class="jstree-facet"
data-facet="<?=$this->escapeHtmlAttr($this->title)?>"
data-path="<?=$this->currentPath()?>"
data-exclude="<?=$allowExclude?>"
data-exclude="<?=$this->allowExclude?>"
data-operator="<?=$this->recommend->getFacetOperator($this->title)?>"
data-exclude-title="<?=$this->transEsc('exclude_facet')?>"
data-sort="<?=isset($this->sortOptions) ? $this->sortOptions : ''?>">
......
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