Feature #94086
openSoftref for custom linkhandler
0%
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 ;-)
Files
Updated by Philipp Kitzberger over 3 years ago
- Tracker changed from Bug to Feature
- TYPO3 Version deleted (
10)
Updated by Benni Mack about 3 years ago
- Status changed from New to Needs Feedback
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?
Updated by corbet dynie almost 3 years ago
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.
Updated by Oliver Weiss almost 3 years ago
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.
Updated by Riccardo De Contardi over 2 years ago
- Status changed from Needs Feedback to New
Updated by Philipp Kitzberger almost 2 years ago
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.bodytext
and dedicated link fields such as tt_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
Updated by Benni Mack over 1 year ago
- Status changed from New to Needs Feedback
so the only thing now is to create a custom linkvalidator now? Or is something missing with v11? Or maybe just documentation?
Updated by Benni Mack over 1 year ago
- Related to Task #96110: Clarify usage of custom linkhandler functionality in redirects module added
Updated by Philipp Kitzberger over 1 year ago
@Benni Mack, 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
Updated by Lina Wolf over 1 year ago
Updated by Philipp Kitzberger over 1 year ago
@Lina Wolf, nope, I'm talking about a chapter on "link validation" (which I cannot find in the docs)
Updated by Sybille Peters 11 months ago
- Related to Bug #102468: Linkvalidator doesn't check record/custom links within RTEs at all added
Updated by Sybille Peters 11 months ago
- Related to Feature #103403: Make it possible to check custom record links with linkvalidator added