Review main Merged

85079[FEATURE] Introduce PSR-14 events for RTE/persistence HTML transforms

Garvin Hicking CR +2 V +2 Hard +691 −2 updated 07/12/24, 09:21

Commit message

With the removal of the old hook `$GLOBALS['TYPO3_CONF_VARS']
['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['transformation']`
there was only a limited way to handle RTE/persistence HTML
transformations.

With the introduction of four new PSR-14 events, the transformation
logic can now also be influenced by extensions:

*  `TYPO3\CMS\Core\Html\Event\BeforeTransformTextForPersistenceEvent`
*  `TYPO3\CMS\Core\Html\Event\AfterTransformTextForPersistenceEvent`
*  `TYPO3\CMS\Core\Html\Event\BeforeTransformTextForRichTextEditorEvent`
*  `TYPO3\CMS\Core\Html\Event\AfterTransformTextForRichTextEditorEvent`

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Stephan Kellermayr +1
  • Verified V +2 Done
    • Benni Mack +2
    • Stephan Kellermayr +1
    • core-ci +1 CI

Issues 2

Files 11

Review log 2129

Show 24 earlier messages
  1. Garvin Hicking uploaded patch set 1 07/02/24, 10:05

  2. core-ci voted on patch set 1 V -1 07/02/24, 10:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60825

  3. Garvin Hicking rebased onto patch set 2 V -1 07/02/24, 10:15

  4. core-ci voted on patch set 2 V -1 07/02/24, 10:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60827

  1. Garvin Hicking rebased onto patch set 3 V -1 07/02/24, 10:51

  2. core-ci voted on patch set 3 V +1 07/02/24, 11:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60835

  3. Garvin Hicking uploaded patch set 4 V +1 07/02/24, 11:06

    Fix typo
  4. core-ci voted on patch set 4 V +1 07/02/24, 11:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60836

  5. Stephan Kellermayr commented on patch set 4 CR +1 V +1 07/02/24, 13:46

    Thanks a million for this wonderful code suggestion!
  6. Stefan Froemken voted on patch set 4 CR +1 07/02/24, 13:56

  7. Georg Ringer voted on patch set 4 CR +1 V +1 07/03/24, 05:54

  8. Guido Schmechel voted on patch set 4 CR +1 V +1 07/03/24, 22:39

  9. Markus Klein voted on patch set 4 CR +1 V +1 07/04/24, 10:55

  10. Benni Mack commented on patch set 4 CR -2 07/04/24, 11:46

    will review carefully (background: I was the one mainly cleaning up the RteHtmlParser class since TYPO3 v8.0, so I want to ensure that the arguments are properly set)
  11. Benni Mack commented on patch set 4 07/12/24, 06:00

    Hey everyone. here is my take on this change: I recently ran into this issue in v12 where the hooks are now removed. However, can somebody quickly enlighten me why we need the RteHtmlParser instance within the Events? I think we can get rid of them...
  12. Garvin Hicking commented on patch set 4 07/12/24, 06:22

    Reply

    My idea here was to make it future proof and provide maximum context. RteHtmlParser carries some state when the event is fired, and I wanted to be able to access it. I don't think it's vital, but I'd rather have it than miss it down the road. I'm fine with either decision.
  13. Benni Mack updated the commit message in patch set 5 CR +1 V +1 07/12/24, 07:12

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  14. core-ci voted on patch set 5 V +1 07/12/24, 07:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61456

  15. Benni Mack commented on patch set 5 CR -1 07/12/24, 07:19

    Reply

    Then let's remove it please. We can add it later-on once we know we need it.
  16. Benni Mack rebased onto patch set 6 CR -1 V +1 07/12/24, 07:44

  17. core-ci voted on patch set 6 V +1 07/12/24, 07:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61459

  18. Garvin Hicking uploaded patch set 7 V +1 07/12/24, 07:55

    Remove RteHtmlParser instance relation
  19. core-ci voted on patch set 7 V -1 07/12/24, 08:01 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61461

  20. Garvin Hicking uploaded patch set 8 V -1 07/12/24, 08:07

    Fix CGL
  21. core-ci voted on patch set 8 V +1 07/12/24, 08:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61462

  22. Garvin Hicking commented on patch set 8 07/12/24, 08:29

    Reply

    Done, is it ok like this?
  23. Stephan Kellermayr commented on patch set 8 CR +1 V +1 07/12/24, 08:51

    As far as my project is concerned (complete replacement of entire elements), I am satisfied with both solutions.
  24. Benni Mack voted on patch set 8 CR +2 V +2 07/12/24, 09:21

  25. Benni Mack merged patch set 9 07/12/24, 09:21