Skip to content

Commit 584326a

Browse files
committed
BUGFIX: Don't require dimensionsCombination in suggest controller
1 parent c0d0cdf commit 584326a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Classes/Controller/SuggestController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function initializeObject()
6262
* @return void
6363
* @throws QueryBuildingException
6464
*/
65-
public function indexAction($term, $contextNodeIdentifier, $dimensionCombination)
65+
public function indexAction($term, $contextNodeIdentifier, $dimensionCombination = null)
6666
{
6767
if ($this->elasticSearchClient === null) {
6868
throw new \RuntimeException('The SuggestController needs an ElasticSearchClient, it seems you run without the flowpack/elasticsearch-contentrepositoryadaptor package, though.', 1487189823);
@@ -109,8 +109,8 @@ protected function buildRequestForTerm($term, $contextNodeIdentifier, $dimension
109109
// and the term is trimmed to alnum characters to avoid errors
110110
$suggestTerm = preg_replace('/[[:^alnum:]]/', '', explode(' ', $term)[0]);
111111

112-
if(!$this->elasticSearchQueryTemplateCache->has($cacheKey)) {
113-
$contentContext = $this->createContentContext('live', json_decode($dimensionCombination, true));
112+
if (!$this->elasticSearchQueryTemplateCache->has($cacheKey)) {
113+
$contentContext = $this->createContentContext('live', $dimensionCombination ? json_decode($dimensionCombination, true) : []);
114114
$contextNode = $contentContext->getNodeByIdentifier($contextNodeIdentifier);
115115

116116
/** @var ElasticSearchQueryBuilder $query */

0 commit comments

Comments
 (0)