Review main Merged

93049[FEATURE] Enable rel option for non-RTE link fields

Eric Harrer CR +2 V +2 Normal +217 −10 updated 03/13/26, 12:26

Commit message

Make the existing rel option in appearance.allowedOptions effective
for TCA type link fields in the regular link browser.

Add optional sixth TypoLink segment support for rel and apply it in
frontend LinkFactory output.

Exclude rel from pages.canonical_link and sys_redirect.target default
configurations: canonical rendering already enforces rel="canonical",
and redirects only consume target URL and query parameters.

Add unit and functional coverage for link browser rendering, TypoLink
codec handling, and frontend link generation.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Georg Ringer +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Georg Ringer +1
    • core-ci +1 CI

Issues 1

Files 11

Review log 1722

  1. Eric Harrer uploaded patch set 1 03/03/26, 20:34

  2. core-ci voted on patch set 1 V +1 03/03/26, 20:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97222

  3. Eric Harrer uploaded patch set 2 V +1 03/03/26, 20:45

  4. Eric Harrer commented on patch set 2 03/03/26, 20:54

    Classification note: I considered both [BUGFIX] and [FEATURE] for this patch. “appearance.allowedOptions” already made ‘rel’ available as a configurable option for fields of type “type=link,” but when not used in RTE, this option was effectively ignored and did not reach the rendered link output. This patch makes the existing configuration effective. Since it changes the observable runtime behavior, I have classified it as [FEATURE]. The current TCA reference also documents `rel` as only available for RTE so far (https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-TCA/blob/main/Documentation/ColumnsConfig/Type/Link/_Properties/_Appearance.rst.txt). After this patch is merged, I would update this accordingly.
  5. core-ci voted on patch set 2 V +1 03/03/26, 20:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97224

  6. Eric Harrer uploaded patch set 3 V +1 03/03/26, 21:03

  7. core-ci voted on patch set 3 V +1 03/03/26, 21:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97225

  8. Eric Harrer uploaded patch set 4 V +1 03/03/26, 21:12

  9. core-ci voted on patch set 4 V +1 03/03/26, 21:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97226

  10. Garvin Hicking commented on patch set 4 03/03/26, 21:55

    AbstractLinkBrowserController.php:509

    please use the short domain syntax for new LLL translation keys

    AbstractLinkBrowserController.php:510

    I don't have the deepest knowledge about this - but do you know where "lrel" is re-used again? This name seems to be a deadend - I also find it in the "BrowseLinksController" but nowhere else?

    LinkElement.php:338

    same here for label notation. Maybe while you're add it you could adjust the ones in the same array too?

    sys_redirect.php:147

    Can you say why 'rel' is removed here in the TCA? What effect could it have to 3rd party TCA if they list 'rel' in their allowedOptions?
  11. Eric Harrer uploaded patch set 5 V +1 03/03/26, 23:13

  12. core-ci voted on patch set 5 V +1 03/03/26, 23:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97234

  13. Eric Harrer commented on patch set 4 03/03/26, 23:25

    AbstractLinkBrowserController.php:509 Reply

    Done

    AbstractLinkBrowserController.php:510 Reply

    `lrel` is not a dead-end; it follows the generic LinkBrowser naming scheme. The browser collects attributes dynamically from `data-linkbrowser-attribute-fields` and reads each input via `name="l" + fieldName`. TypeScript source reference: Build/Sources/TypeScript/backend/link-browser.ts (method `getLinkAttributeValues()`). So for field `rel`, the expected input name is `lrel`.

    LinkElement.php:338 Reply

    Done

    sys_redirect.php:147 Reply

    This follows the same principle as for `pages.canonical_link`: we only keep options that are actually consumed by runtime behavior. Before this patch, these `rel` inputs were effectively not shown for non-RTE link fields; with this patch they would become visible. For these two specific fields, showing them would be unnecessary and likely irritate editors, because the values are not meaningfully consumed there. - For `pages.canonical_link`, canonical rendering already enforces `rel="canonical"`. - For `sys_redirect.target`, redirect processing consumes only `url` and `additionalParams` (query handling), but not `rel`. Both cases (including rationale) are already documented in this commit message.
  14. Garvin Hicking commented on patch set 5 CR +1 V +1 03/04/26, 13:09

    AbstractLinkBrowserController.php:510 Reply

    Thanks!

    sys_redirect.php:147 Reply

    Oh I'm sorry, I totally overread that part. Thanks!
  15. Georg Ringer commented on patch set 5 CR +1 V +1 03/04/26, 16:39

    would like @benni@typo3.org to review that
  16. Benni Mack commented on patch set 5 CR -1 03/04/26, 16:47

    This is a huge deal: We extend TypoLink with a "sixth" parameter. We could however change the Typolink syntax now to add A-Tag attributes as the second parameter and slim down this syntax completely Example: 42 'class="my-class" rel="my-rel"' ... WDYT? Asking @markus.klein@typo3.org for another opinion?
  17. Garvin Hicking commented on patch set 5 03/04/26, 17:56

    Reply

    That sounds like asking for breakage, as there are likely parsers for "raw" bodytext patterns out there, and we'd have to create SQL based migrations?! Or we have to create nasty fallback logic to detect if the second argument is "all arguments"?! A sixth parameter will likely pass any custom argument parsing and existing data.
  18. Eric Harrer commented on patch set 5 03/04/26, 20:01

    Reply

    Argument 2 is currently defined and consumed as `target` in core parsing/rendering. Extending argument 2 as suggested would therefore change semantics of an existing argument position, not just add functionality. The 6th-argument solution avoids that semantic shift and keeps this change "Breaking Change"-free: - Existing TypoLink parsing (1–5 segments) remains unchanged. - Existing TypoLink values are not reinterpreted. - Existing TypoLink values do not need migration, regardless of where they are used (database records, TypoScript, Fluid templates, or values passed through PHP code). This patch only adds an optional trailing 6th segment (`rel`) when explicitly used.
  19. Markus Klein commented on patch set 5 03/13/26, 11:50

    Reply

    @benni@typo3.org I'm really not sure. I guess the 6th argument is a safe path. Making a complete restructuring of typolink legacy-syntax is maybe not benefitial. I rather would drop the old syntax at some point completely. In general I'm not a fan of "html markup" in link fields. I already anticipate the advanced editors messing around with this. 🙈
  20. Benni Mack commented on patch set 5 CR 0 03/13/26, 12:13

    Reply

    Yeah, i thought about this issue now for a while as well, and I'm fine with this one.
  21. Garvin Hicking voted on patch set 5 CR +2 V +2 03/13/26, 12:26

  22. Garvin Hicking merged patch set 6 03/13/26, 12:26