Issue Bug Closed

#91979detectDomainRecords.target is set but no target is in a-tag

Joe Jones 08/11/20, 16:36 updated 09/08/20, 11:43

Description

Dear dev-team,

I had problems, giving the links of the searchresults a target. In the Dokumentation there is detectDomainRecords.target, but is has no effect. I checkt the sourcecode and found the mistake in Classes/Controller/SearchController.php:

 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]);
            $uri = $scheme . $firstDomain . $uri;
*********   $target = $this->settings['detectDomainRecords.']['target'];*********
            print_r( $this->settings['detectDomainRecords']['target']);
        }

        return ['uri' => $uri, 'target' => $target];
    }

The marked line must be:

$target = $this->settings['detectDomainRecords']['target'];

Maybe you can verfy this and patch it the next time.

Thank you and regards
Martin

Reviews 2

History 36

  1. Georg Ringer commented and changed status New Under Review 08/12/20, 08:36

    thanks for the report. can you check out the change at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65285

    I did a different approach as otherwise `detectDomainRecords =0` needs to be detected as well.

  2. Gerrit Code Review pushed patch set 2 for master to change 65285 08/13/20, 13:27

  3. Gerrit Code Review pushed patch set 3 for master to change 65285 08/18/20, 19:35

  4. Gerrit Code Review pushed patch set 1 for 10.4 to change 65416 08/21/20, 17:48

  5. Georg Ringer commented and changed status Under Review Resolved done 0 % 100 % 08/21/20, 18:00

    Applied in changeset commit:37ea9780d92920813a5e1c9c5cd9cdb8dde3a447.

  6. Benni Mack changed status Resolved Closed 09/08/20, 11:43