#94086Softref for custom linkhandler
Description
In our project we’ve got a custom linkhandler set up that works with external entities and the following link format: t3 ://foo?subtype=bar&identifier=123
Just to be clear: it’s not a record linkhandler!
When trying to config the EXT:linkvalidator we’ve noticed that it uses the “softref index” to identify the links to be validated.
tt_content.bodytext is configured via TCA to have this softref configuration: typolink_tag,email[subst],url
In \TYPO3\CMS\Core\Database\SoftReferenceIndex::findRef_typolink_tag only these types seem to be processed though:
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) {
...
}
Am I right that LinkService::TYPE_RECORD and our custom linkhandler is not being processed at the moment? Just to be sure before investing time and creating a patch ;-)
Reviews 2
Related issues 4
- Task #96110Clarify usage of custom linkhandler functionality in redirects module
- Bug #102468Linkvalidator doesn't check record/custom links within RTEs at all
- Feature #103403Make it possible to check custom record links with linkvalidator
- Bug #107186TypolinkTagSoftReferenceParser limited to core known link types
Files 1
History 1720
-
Philipp Kitzberger changed tracker
BugFeature TYPO3 Version10<span data-processor="relativetime" data-value="2021-05-07T02:21:30+00:00" > 05/07/21, 02:21 </span> -
Benni Mack commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2021-11-25T11:00:24+00:00" > 11/25/21, 11:00 </span> -
corbet dynie changed attached patch <span data-processor="relativetime" data-value="2022-03-11T15:00:56+00:00" > 03/11/22, 15:00 </span>
-
corbet dynie commented and changed attached patch <span data-processor="relativetime" data-value="2022-03-11T15:24:28+00:00" > 03/11/22, 15:24 </span>
I had the same problem with v10.4 and I think it is a bug.
All soft reference parsers take care of records except typolink_tag. -
corbet dynie changed
patch<span data-processor="relativetime" data-value="2022-03-11T15:26:50+00:00" > 03/11/22, 15:26 </span> -
Oliver Weiss commented <span data-processor="relativetime" data-value="2022-03-29T10:43:16+00:00" > 03/29/22, 10:43 </span>
corbet dynie wrote in #note-4:
> I had the same problem with v10.4 and I think it is a bug.
> All soft reference parsers take care of records except typolink_tag.I can confirm this. records are not checked by linkvalidator. I think, this is a must-have.
-
Riccardo De Contardi changed status
Needs FeedbackNew <span data-processor="relativetime" data-value="2022-09-17T09:24:28+00:00" > 09/17/22, 09:24 </span> -
Philipp Kitzberger commented <span data-processor="relativetime" data-value="2023-02-17T14:51:32+00:00" > 02/17/23, 14:51 </span>
> Can you check if you can now integrate custom Link Handler checks?
Thanks, Benni! With the TYPO3 11 implementation of the linkvalidator it was now possible to implement handling for our custom typolink format.
To cover all cases (links within
tt_content.bodytextand dedicated link fields such astt_content.header_link) I had to implement the following:EXT:my_extension/ext_localconf.php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks']['custom'] = \MyVendor\MyExtension\LinkValidation\CustomUriValidator::class;
EXT:my_extension/Configuration/TCA/Overrides/tt_content.php
$GLOBALS['TCA']['tt_content']['columns']['bodytext']['config']['softref'] .= ',custom'; $GLOBALS['TCA']['tt_content']['columns']['header_link']['config']['softref'] .= ',custom';
EXT:my_extension/Configuration/Services.yaml
services: MyVendor\MyExtension\LinkValidation\CustomUriResolver: tags: - name: event.listener event: TYPO3\CMS\Core\DataHandling\Event\AppendLinkHandlerElementsEvent MyVendor\MyExtension\LinkValidation\CustomUriParser: tags: - name: softreference.parser parserKey: custom -
Benni Mack commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2023-07-05T19:53:53+00:00" > 07/05/23, 19:53 </span>so the only thing now is to create a custom linkvalidator now? Or is something missing with v11? Or maybe just documentation?
-
Benni Mack changed Related to #96110 <span data-processor="relativetime" data-value="2023-07-05T19:54:13+00:00" > 07/05/23, 19:54 </span>
-
Philipp Kitzberger commented <span data-processor="relativetime" data-value="2023-07-06T08:21:03+00:00" > 07/06/23, 08:21 </span>
@benni, yeah, maybe it’s just documentation now that’s missing. I’m often confused about the docs on these topics to be honest. Linkhandler vs. linkbrowser vs. linkvalidator. I guess the chapter on custom linkvalidators is missing completely? https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/LinkHandling/Index.html
-
Lina Wolf commented <span data-processor="relativetime" data-value="2023-07-06T08:57:43+00:00" > 07/06/23, 08:57 </span>
@kitzberger is this what you are missing? https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/LinkHandling/Tutorials/CustomLinkBrowser.html
-
Philipp Kitzberger commented <span data-processor="relativetime" data-value="2023-07-06T08:59:42+00:00" > 07/06/23, 08:59 </span>
@linawolf, nope, I’m talking about a chapter on “link validation” (which I cannot find in the docs)
-
Sybille Peters changed Related to #102468 <span data-processor="relativetime" data-value="2024-03-15T09:10:43+00:00" > 03/15/24, 09:10 </span>
-
Sybille Peters changed Related to #103403 <span data-processor="relativetime" data-value="2024-03-15T09:47:05+00:00" > 03/15/24, 09:47 </span>
-
Daniel Siepmann changed Related to #107186 <span data-processor="relativetime" data-value="2025-07-31T12:06:10+00:00" > 07/31/25, 12:06 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 97054 status
Needs FeedbackUnder Review <span data-processor="relativetime" data-value="2026-10-23T07:43:31+00:00" > 10/23/26, 07:43 </span> -
Gerrit Code Review pushed patch set 2 for main to change 97054 <span data-processor="relativetime" data-value="2026-10-23T13:43:21+00:00" > 10/23/26, 13:43 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 97081 <span data-processor="relativetime" data-value="2026-10-23T14:01:34+00:00" > 10/23/26, 14:01 </span>
-
Georg Ringer commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-10-23T14:05:13+00:00" > 10/23/26, 14:05 </span>Applied in changeset commit:7112602de2160e23c8b8212c8571460ce6d26367.
Hey Philipp,
the SoftRefParser has now been completely refactored and is now fully extendable (v11). Can you check if you can now integrate custom Link Handler checks?