[BUGFIX] Remove hardcoded index.php indexed search links 87/58387/3
authorFrank Naegler <frank.naegler@typo3.org>
Tue, 25 Sep 2018 10:53:18 +0000 (12:53 +0200)
committerSusanne Moog <susanne.moog@typo3.org>
Sun, 30 Sep 2018 21:07:53 +0000 (23:07 +0200)
Resolves: #86326
Releases: master
Change-Id: Ifbe8c5067c5a7e47188ea89f4e6df3db9192ac61
Reviewed-on: https://review.typo3.org/58387
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/indexed_search/Classes/Controller/SearchController.php

index e31c1b2..3096c76 100644 (file)
@@ -1603,23 +1603,19 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
     protected function preparePageLink(int $pageUid, array $row, array $urlParameters): array
     {
         $target = '';
+        $uri = $this->controllerContext->getUriBuilder()
+                ->setTargetPageUid($pageUid)
+                ->setTargetPageType($row['data_page_type'])
+                ->setUseCacheHash(true)
+                ->setArguments($urlParameters)
+                ->build();
+
         // If external domain, then link to that:
         if (!empty($this->domainRecords[$pageUid])) {
             $scheme = GeneralUtility::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://';
             $firstDomain = reset($this->domainRecords[$pageUid]);
-            $additionalParams = '';
-            if (is_array($urlParameters) && !empty($urlParameters)) {
-                $additionalParams = GeneralUtility::implodeArrayForUrl('', $urlParameters);
-            }
-            $uri = $scheme . $firstDomain . '/index.php?id=' . $pageUid . $additionalParams;
+            $uri = $scheme . $firstDomain . $uri;
             $target = $this->settings['detectDomainRecords.']['target'];
-        } else {
-            $uriBuilder = $this->controllerContext->getUriBuilder();
-            $uri = $uriBuilder->setTargetPageUid($pageUid)
-                ->setTargetPageType($row['data_page_type'])
-                ->setUseCacheHash(true)
-                ->setArguments($urlParameters)
-                ->build();
         }
 
         return ['uri' => $uri, 'target' => $target];