Project

General

Profile

Actions

Bug #81364

closed

Epic #65814: Make Indexed search extbase plugin shine

Internal links get treated as external links by linkPage()

Added by Nico Niebergall almost 7 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Indexed Search
Target version:
-
Start date:
2017-05-29
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I currently have the issue that indexed_search treats search result links as "external" when in reality, they are internal links. I'm referring to a specific part in indexed_search's source code; see explanation/details:

This (IMHO) wrong behaviour results in links not going through the TYPO3 URIBuilder (and therefore realURL), e.g. domain.tld/index.php?id=18 vs. domain.tld/contact.html. I tracked this down to \TYPO3\CMS\IndexedSearch\Controller\SearchController, line 1326 in the linkPage() function:

            if (!empty($this->domainRecords[$pageUid])) {
              // Handle external link
            } else {
              // Handle internal link
            }

IMHO, the negation of empty() should be removed, e.g. "if there is no domain record, this is an external link.." instead of "if there is a domain record, this is an external link":

            if (empty($this->domainRecords[$pageUid])) {
              // Handle external link
            } else {
              // Handle internal link
            }

If I remove the negation, the extension behaves as expected and shows the correct link(s), e.g. /contact.html instead of /index.php?id=18. Hopefully, this is an actual issue and not a result of an oversight of mine. ;-)

In any case, I hope someone more involved in the core's development can shed some light on this! If that's indeed the way to fix this, I'd also be willing to contribute this myself.

Thank you in advance!

Actions

Also available in: Atom PDF