Skip to content

Commit

Permalink
[FIX] Re-added template variables for SearchFormViewHelper
Browse files Browse the repository at this point in the history
This PR re-introduces the template variables in the SearchFormViewHelper

Fixes: TYPO3-Solr#4117
  • Loading branch information
thomashohn authored and dkd-kaehm committed Jul 26, 2024
1 parent ea50dc2 commit 8f60143
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Classes/ViewHelpers/SearchFormViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,27 @@ public function render()
// @extensionScannerIgnoreLine
$this->getTemplateVariableContainer()->add('q', $this->getQueryString());
// @extensionScannerIgnoreLine
$this->getTemplateVariableContainer()->add('pageUid', $pageUid);
// @extensionScannerIgnoreLine
$this->getTemplateVariableContainer()->add(
'languageUid',
($this->renderingContext->getRequest()->getAttribute('language')?->getLanguageId() ?? 0)
);
// @extensionScannerIgnoreLine
$this->getTemplateVariableContainer()->add('existingParameters', $this->getExistingSearchParameters());
// @extensionScannerIgnoreLine
// Added addPageAndLanguageId for compatibility
$this->getTemplateVariableContainer()->add('addPageAndLanguageId', false);
$formContent = $this->renderChildren();
// @extensionScannerIgnoreLine
$this->getTemplateVariableContainer()->remove('addPageAndLanguageId');
// @extensionScannerIgnoreLine
$this->getTemplateVariableContainer()->remove('q');
// @extensionScannerIgnoreLine
$this->getTemplateVariableContainer()->remove('pageUid');
// @extensionScannerIgnoreLine
$this->getTemplateVariableContainer()->remove('languageUid');
// @extensionScannerIgnoreLine
$this->getTemplateVariableContainer()->remove('existingParameters');

$this->tag->setContent($formContent);
Expand Down

0 comments on commit 8f60143

Please sign in to comment.