Review main Merged

90938[BUGFIX] Fix unlinking of anchors to hidden or deleted pages in RTE

Benjamin Franzke CR +2 V +2 Easy +2 −1 updated 11/13/25, 14:37

Commit message

When RTE content is loaded from database the attribute `data-rte-error`
is added to the markup when the linked record is hidden or deleted.

The Typo3UnlinkCommand needs to remove this data attribute in order for
CKEditor to remove the surrounding `<a>`.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Andreas Nedbal +1
    • Garvin Hicking +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Andreas Nedbal +1
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 78

  1. Benjamin Franzke uploaded patch set 1 10/07/25, 08:59

  2. core-ci voted on patch set 1 V +1 10/07/25, 09:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86139

  3. Garvin Hicking commented on patch set 1 CR +1 V +1 10/07/25, 09:39

    typo3-link.ts:257

    What about possible other data-attributes that might have been applied to a link via other extensions? Could we iterate on the link to remove ALL of them to be sure?
  4. Benjamin Franzke commented on patch set 1 10/07/25, 13:05

    typo3-link.ts:257 Reply

    Such custom attributes are to be allowed via Generic HTML Support (GHS): https://ckeditor.com/docs/ckeditor5/latest/features/html/general-html-support.html E.g. ``` editor: config: htmlSupport: allow: - name: 'a' attributes: data-foo: true ``` Then those data attributes are collected in a generic `htmlA` link attribute (can be diagnosed via the CKEditor inspector), which is automatically removed when `linkHref` attribute is removed because it is coupled to this attribute, see: https://github.com/ckeditor/ckeditor5/blob/cf03068f77ea093ea60b60155687af8215a5c72d/packages/ckeditor5-html-support/src/schemadefinitions.ts#L704 `data-rte-error` is special, since it is not registered via GHS, but as a custom link attribute within our link plugin, therefore this attribute needs to be removed explicitly. Ideally all our custom link attributes would be coupled to `linkHref`, so that ` writer.removeAttribute('linkHref, range)` would remove all link attributes automatically, but I didn't look intro rewriting that part yet. TL;DR other data-* attributes – if allowed to be used – can be removed during unlinking.
  5. Garvin Hicking commented on patch set 1 10/07/25, 13:22

    typo3-link.ts:257 Reply

    Oh no I didn't want to chase you through a rabbit hole. Thanks for this research, that sounds good to go to me.
  6. Andreas Nedbal voted on patch set 1 CR +1 V +1 11/13/25, 14:14

  7. Benjamin Franzke voted on patch set 1 CR +2 V +2 11/13/25, 14:25

  8. Benjamin Franzke merged patch set 2 11/13/25, 14:37