Actions
Bug #102468
openLinkvalidator doesn't check record/custom links within RTEs at all
Status:
New
Priority:
Should have
Assignee:
-
Category:
Linkvalidator
Target version:
-
Start date:
2023-11-22
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
I was wondering why EXT:linkvalidator 11 wasn't checking "record links" and "custom link types" and found this after debugging the matter a while.
There's a big switch statement in TypolinkSoftReferenceParser (which is used for typolink fields such as tt_content.header_link
):
switch ((string)$tLP['type']) { case LinkService::TYPE_EMAIL: case LinkService::TYPE_TELEPHONE: case LinkService::TYPE_URL: case LinkService::TYPE_FOLDER: case LinkService::TYPE_FILE: case LinkService::TYPE_PAGE: case LinkService::TYPE_RECORD: default: $event = new AppendLinkHandlerElementsEvent($tLP, $content, $elements, $idx, $tokenID); }In Typolink*Tag*SoftReferenceParser (which is being used for RTE fields such as
tt_content.bodytext
) that switch statement is slightly smaller:if ($linkDetails['type'] === LinkService::TYPE_FILE && preg_match('/file\?uid=(\d+)/', $matches[1], $fileIdMatch)) { } elseif ($linkDetails['type'] === LinkService::TYPE_PAGE && preg_match('/page\?uid=(\d+)#?(\d+)?/', $matches[1], $pageAndAnchorMatches)) { } elseif ($linkDetails['type'] === LinkService::TYPE_URL) { } elseif ($linkDetails['type'] === LinkService::TYPE_EMAIL) { } elseif ($linkDetails['type'] === LinkService::TYPE_TELEPHONE) { }Unfortunately the latter is neither covering TYPE_FOLDER & TYPE_RECORD nor dispatching the event for handling custom linkhandlers.
Actions