diff --git a/Classes/IndexQueue/PageIndexer.php b/Classes/IndexQueue/PageIndexer.php index 695a165bdc..7593998e65 100644 --- a/Classes/IndexQueue/PageIndexer.php +++ b/Classes/IndexQueue/PageIndexer.php @@ -22,7 +22,6 @@ use ApacheSolrForTypo3\Solr\Domain\Index\PageIndexer\PageUriBuilder; use ApacheSolrForTypo3\Solr\NoSolrConnectionFoundException; use ApacheSolrForTypo3\Solr\System\Solr\SolrConnection; -use ApacheSolrForTypo3\Solr\System\Util\SiteUtility; use Doctrine\DBAL\Exception as DBALException; use Exception; use Psr\Log\LogLevel; @@ -228,8 +227,7 @@ protected function getPageIndexerRequest(): PageIndexerRequest */ protected function getDataUrl(Item $item, int $language = 0): string { - $pageId = $item->getRecordUid(); - $uriBuilder = $this->getUriBuilder($pageId); + $uriBuilder = $this->getUriBuilder(); $mountPointParameter = $this->getMountPageDataUrlParameter($item); return $uriBuilder->getPageIndexingUriFromPageItemAndLanguageId($item, $language, $mountPointParameter, $this->options); } @@ -239,12 +237,8 @@ protected function getDataUrl(Item $item, int $language = 0): string * * @throws \Exception */ - protected function getUriBuilder(int $pageId): PageUriBuilder + protected function getUriBuilder(): PageUriBuilder { - if (!SiteUtility::getIsSiteManagedSite($pageId)) { - throw new \Exception('Site of page with uid ' . $pageId . ' is not a TYPO3 managed site'); - } - return GeneralUtility::makeInstance(PageUriBuilder::class); } diff --git a/Classes/System/Util/SiteUtility.php b/Classes/System/Util/SiteUtility.php index 41a588a966..1cdd9a5595 100644 --- a/Classes/System/Util/SiteUtility.php +++ b/Classes/System/Util/SiteUtility.php @@ -16,10 +16,7 @@ namespace ApacheSolrForTypo3\Solr\System\Util; use ApacheSolrForTypo3\Solr\Domain\Site\Site as ExtSolrSite; -use TYPO3\CMS\Core\Exception\SiteNotFoundException; use TYPO3\CMS\Core\Site\Entity\Site as CoreSite; -use TYPO3\CMS\Core\Site\SiteFinder; -use TYPO3\CMS\Core\Utility\GeneralUtility; /** * This class contains related functions for the new site management that was introduced with TYPO3 9. @@ -39,20 +36,6 @@ public static function reset(): void self::$languages = []; } - /** - * Determines if the site where the page belongs to is managed with the TYPO3 site management. - */ - public static function getIsSiteManagedSite(int $pageId): bool - { - $siteFinder = GeneralUtility::makeInstance(SiteFinder::class); - try { - /** @var SiteFinder $siteFinder */ - return $siteFinder->getSiteByPageId($pageId) instanceof CoreSite; - } catch (SiteNotFoundException) { - } - return false; - } - /** * This method is used to retrieve the connection configuration from the TYPO3 site configuration. * diff --git a/Classes/ViewHelpers/SearchFormViewHelper.php b/Classes/ViewHelpers/SearchFormViewHelper.php index c66f8f07a8..e6eb48c0d4 100644 --- a/Classes/ViewHelpers/SearchFormViewHelper.php +++ b/Classes/ViewHelpers/SearchFormViewHelper.php @@ -18,7 +18,6 @@ namespace ApacheSolrForTypo3\Solr\ViewHelpers; use ApacheSolrForTypo3\Solr\System\Url\UrlHelper; -use ApacheSolrForTypo3\Solr\System\Util\SiteUtility; use TYPO3\CMS\Core\Context\Exception\AspectNotFoundException; use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; @@ -106,26 +105,12 @@ 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 - $this->getTemplateVariableContainer()->add('addPageAndLanguageId', !$this->getIsSiteManagedSite($pageUid)); $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); @@ -174,16 +159,6 @@ protected function translateSearchParametersToInputTagAttributes( return $attributes; } - /** - * When a site is managed with site management the language and the id are encoded in the path segment of the url. - * When no speaking urls are active (e.g. with TYPO3 8 and no realurl) this information is passed as query parameter - * and would get lost when it is only part of the query arguments in the action parameter of the form. - */ - protected function getIsSiteManagedSite(int $pageId): bool - { - return SiteUtility::getIsSiteManagedSite($pageId); - } - protected function getTemplateVariableContainer(): ?VariableProviderInterface { return $this->templateVariableContainer; diff --git a/Resources/Private/Partials/Search/Form.html b/Resources/Private/Partials/Search/Form.html index 3959328ec8..fc11102627 100644 --- a/Resources/Private/Partials/Search/Form.html +++ b/Resources/Private/Partials/Search/Form.html @@ -12,11 +12,6 @@ - - - - -