Review main Merged

80035[BUGFIX] Mark broken links in RTE again

Sybille Peters CR +2 V +2 Easy +28 −2 updated 09/07/23, 06:54

Commit message

The possibility to mark broken links with the `data-rte-error`
attribute and styling was removed in TYPO3 v12.

This is now added again to allow for linkvalidator and other
extensions to mark broken links which will then be visibly
styled differently when editing in the RTE.

This affects only the backend. The attribute data-rte-error is
removed when persisting the content to the database.

The logic for adding this attribute is still in place:
The linkvalidator uses the event `BrokenLinkAnalysisEvent`
which is dispatched in `RteHtmlParser`.

A marked broken link may look like this:

```html
<a href="t3://page?uid=42"
  data-rte-error="External link is broken">link</a>
```

Note that the functionality got disabled with the new ckeditor
in #96874 while the implementing plugin "showbrokenlinks" was
removed later with #98497. The CSS is therefore restored from
the state as of before #98497.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Benjamin Franzke +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Benjamin Franzke +1
    • core-ci +1 CI

Issues 3

Files 3

Review log 1825

  1. Sybille Peters uploaded patch set 1 07/15/23, 08:01

  2. core-ci voted on patch set 1 V +1 07/15/23, 08:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44160

  3. Oliver Klee updated the commit message in patch set 2 V +1 07/15/23, 08:57

  4. Oliver Klee updated the commit message in patch set 3 07/15/23, 08:58

  5. core-ci voted on patch set 2 V +1 07/15/23, 09:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44161

  6. Sybille Peters commented on patch set 3 07/15/23, 09:09

    Thanks Oli :)
  7. core-ci voted on patch set 3 V +1 07/15/23, 09:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44162

  8. Stefan Bürk commented on patch set 3 07/15/23, 21:00

    Can we have the change removing this in v12 added as related to the commit message and issue please ?
  9. Sybille Peters updated the commit message in patch set 4 V +1 07/16/23, 06:45

  10. Sybille Peters commented on patch set 4 07/16/23, 06:46

    Reply

    It's a little more complicated. Only the css part was explicitly removed. The plugin/Typescript part was just not added when switching to ckeditor5 - previously it was unnecessary, but in ckeditor5 you have to handle all HTML elements and attributes in a plugin or else they will be removed. The most relevant patch to switch would be this: "Integrate CKEditor5 as new RTE" https://review.typo3.org/c/Packages/TYPO3.CMS/+/75480 with issue https://forge.typo3.org/issues/96874 where the previous plugin "showbrokenlinks" was not migrated and typo3-link.ts was added. I will add it as related but am a bit puzzled if this is common practice because it will notify people in hte issue for every action on this review.
  11. Sybille Peters commented on patch set 4 07/16/23, 06:52

    I also thought about adding tests since this is the second time the behaviour was removed in core. Should we add acceptance tests and should that be in this patch or as separate? (I looked at existing acceptance tests in core, neither linkvalidator nor rte_ckeditor are handled so would have to start that from scratch. Also I have zero experience with acceptance tests in core but I think I can figure it out myself.)
  12. Stefan Bürk commented on patch set 4 07/16/23, 06:55

    Reply

    Adding the corresponding change as related is done commonly, at least if the commit message state that it is realted to "something". For example if a prior change broke something. Or even if there is a chain of related changes. In this case, it seems to be a left-over from the CKEditor version replacement, and taking that as the "major" related change is sufficient (for me). Thank you for adding it and the explanation in the comment.
  13. Stefan Bürk commented on patch set 4 07/16/23, 07:00

    Reply

    Havin tests would be fine. However, in this case I would be fine to have them at a later point to not delay this fix because of the acceptance tests. So you could try to add acceptanfce tests in a dedicated change, and covering this or other things eventually. And getting help on that if you "hung". IMO I would not make the "ac tests" here as blocker for the fix.
  14. core-ci voted on patch set 4 V +1 07/16/23, 07:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44186

  15. Sybille Peters uploaded patch set 5 V +1 08/12/23, 09:11

  16. core-ci voted on patch set 5 V +1 08/12/23, 09:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45406

  17. Sybille Peters wrote 08/13/23, 09:13

    Topic set to linkvalidator
  18. Sybille Peters uploaded patch set 6 V +1 08/19/23, 11:48

  19. core-ci voted on patch set 6 V +1 08/19/23, 11:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45619

  20. Benjamin Franzke uploaded patch set 7 V +1 09/07/23, 06:07

  21. Benjamin Franzke commented on patch set 7 09/07/23, 06:07

    Reply

    I've added #98497 as well now, to show where the CSS is coming from that we're adding back.
  22. core-ci voted on patch set 7 V +1 09/07/23, 06:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46321

  23. Stefan Bürk voted on patch set 7 CR +1 09/07/23, 06:27

  24. Stefan Bürk voted on patch set 7 V +2 CR +2 09/07/23, 06:38

  25. Stefan Bürk merged patch set 8 09/07/23, 06:54