diff --git a/Classes/Controller/SearchController.php b/Classes/Controller/SearchController.php index 13aa96d441..891ea392dd 100644 --- a/Classes/Controller/SearchController.php +++ b/Classes/Controller/SearchController.php @@ -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); @@ -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); @@ -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(); @@ -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(); }