Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions Classes/Controller/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ public function mainAction(): void
return;
}

// Get additional fields for extended search.
$this->addExtendedSearch();

// if search was triggered, get search parameters from POST variables
$this->searchParams = $this->getParametersSafely('searchParameter');
// if search was triggered by the ListView plugin, get the parameters from GET variables
Expand Down Expand Up @@ -204,9 +207,6 @@ public function mainAction(): void
$this->addFacetsMenu();
}

// Get additional fields for extended search.
$this->addExtendedSearch();

// Add the current document if present to fluid. This way, we can limit further searches to this document.
if (isset($this->requestData['id'])) {
$currentDocument = $this->documentRepository->findByUid($this->requestData['id']);
Expand Down Expand Up @@ -574,13 +574,9 @@ private function addExtendedSearch(): void

// Get field selector options.
$searchFields = GeneralUtility::trimExplode(',', $this->settings['extendedFields'], true);
$extendedSlotCount = range(0, (int) $this->settings['extendedSlotCount'] - 1);

$slotCountArray = [];
for ($i = 0; $i < $this->settings['extendedSlotCount']; $i++) {
$slotCountArray[] = $i;
}

$this->view->assign('extendedSlotCount', $slotCountArray);
$this->view->assign('extendedSlotCount', $extendedSlotCount);
$this->view->assign('extendedFields', $this->settings['extendedFields']);
$this->view->assign('operators', ['AND', 'OR', 'NOT']);
$this->view->assign('searchFields', $searchFields);
Expand Down