Skip to content

Commit

Permalink
Return in SearchController if no search parameters exist
Browse files Browse the repository at this point in the history
  • Loading branch information
beatrycze-volk committed May 29, 2024
1 parent 8d37dc1 commit 2cd2041
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Classes/Controller/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ public function mainAction(): void
$this->searchParams = $this->getParametersSafely('searchParameter');
// if search was triggered by the ListView plugin, get the parameters from GET variables
$listRequestData = GeneralUtility::_GPmerged('tx_dlf_listview');
// Quit without doing anything if no search parameters.
if(empty($this->searchParams) && empty($listRequestData)) {

Check notice on line 119 in Classes/Controller/SearchController.php

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

Classes/Controller/SearchController.php#L119

Expected "if (...) {\n"; found "if(...) {\n"

Check notice on line 119 in Classes/Controller/SearchController.php

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

Classes/Controller/SearchController.php#L119

Expected 1 space after IF keyword; 0 found
$this->logger->warning('Missing search parameters');
return;
}

if (isset($listRequestData['searchParameter']) && is_array($listRequestData['searchParameter'])) {
$this->searchParams = array_merge($this->searchParams ?: [], $listRequestData['searchParameter']);
Expand Down

0 comments on commit 2cd2041

Please sign in to comment.