Skip to content

Commit

Permalink
Fix missing return for redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
chrizzor committed May 13, 2024
1 parent 6ff3c88 commit 470d7ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Classes/Controller/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function indexAction(): ResponseInterface
$redirectQueries = [];
if ($this->settings['redirectAllOneHitToDetail']) {
$docId = $defaultQuery['results']->getData()['response']['docs'][0]['id'];
$this->redirect('detail', NULL, NULL, ['id' => $docId]);
return $this->redirect('detail', NULL, NULL, ['id' => $docId]);
} else {
foreach ($this->settings['queryFields'] as $querySettings) {
if ($querySettings['redirectToDetail']) {
Expand All @@ -143,7 +143,7 @@ public function indexAction(): ResponseInterface
foreach ($this->requestArguments['q'] as $queryId => $queryTerm) {
if (array_key_exists($queryId, $redirectQueries)) {
$docId = $defaultQuery['results']->getData()['response']['docs'][0]['id'];
$this->redirect('detail', NULL, NULL, ['id' => $docId]);
return $this->redirect('detail', NULL, NULL, ['id' => $docId]);
}
}
}
Expand Down

0 comments on commit 470d7ec

Please sign in to comment.