Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Add contentObjectData to searchController #4059

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
9 changes: 8 additions & 1 deletion Classes/Controller/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public function resultsAction(): ResponseInterface
'pagination' => $afterSearchEvent->getPagination(),
'currentPage' => $afterSearchEvent->getCurrentPage(),
'additionalVariables' => $afterSearchEvent->getAdditionalVariables(),
'contentObjectData' => $this->request->getAttribute('currentContentObject')?->data,
];

$this->view->assignMultiple($values);
Expand Down Expand Up @@ -179,6 +180,7 @@ public function formAction(): ResponseInterface
'search' => $formEvent->getSearch(),
'additionalFilters' => $formEvent->getAdditionalFilters(),
'pluginNamespace' => $formEvent->getPluginNamespace(),
'contentObjectData' => $this->request->getAttribute('currentContentObject')?->data,
];

$this->view->assignMultiple($values);
Expand Down Expand Up @@ -212,6 +214,7 @@ public function frequentlySearchedAction(): ResponseInterface
$values = [
'additionalFilters' => $afterFrequentlySearchedEvent->getAdditionalFilters(),
'resultSet' => $afterFrequentlySearchedEvent->getResultSet(),
'contentObjectData' => $this->request->getAttribute('currentContentObject')?->data,
];
$this->view->assignMultiple($values);
return $this->htmlResponse();
Expand All @@ -230,7 +233,11 @@ public function detailAction(string $documentId = ''): ResponseInterface

try {
$document = $this->searchService->getDocumentById($documentId);
$this->view->assign('document', $document);
$values = [
'document' => $document,
'contentObjectData' => $this->request->getAttribute('currentContentObject')?->data,
];
$this->view->assignMultiple($values);
} catch (SolrUnavailableException) {
return $this->handleSolrUnavailable();
}
Expand Down