Bug #81364
closedEpic #65814: Make Indexed search extbase plugin shine
Internal links get treated as external links by linkPage()
0%
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!
Updated by Jan Loderhose over 6 years ago
I can confirm the finding and the suggested solution.
Updated by Riccardo De Contardi over 5 years ago
Does this issue still happen on 9.5.5? As far as I can see, the function linkPage
has changed from the one on version 8.7
Updated by Benni Mack over 4 years ago
- Status changed from New to Closed
Yup. v9 solved the issue through Site Handling