Review main Merged

73688[BUGFIX] Prevent YAML escaping from being displayed in form labels

waldhacker CR +2 V +2 Normal +74 −2 updated 02/25/22, 12:46

Commit message

To make the form manager and form plugins load faster,
the patch https://review.typo3.org/c/Packages/TYPO3.CMS/+/58054/
optimized the parsing of form definitions. Instead of using the
YAML parser, a very rudimentary "parser" was introduced. This works
fine, except for the fact that YAML escapes in form labels
are not unescaped when displayed.

This patch partially reintroduces the parsing of YAML, but only for
the label.

The performance drops only slightly.

10000x "loadMetaData()" (status quo) = 0.41 seconds
10000x "loadMetaData()" + parse label with yaml parser = 0.57 seconds
10000x parse the whole form definition with yaml parser = 7.57 seconds

Review

  • Code review CR +2 Done
    • Oliver Hader +2
    • Björn Jacob +1
    • Andreas Steiger +1
  • Verified V +2 Done
    • Oliver Hader +2
    • Björn Jacob +1
    • Andreas Steiger +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 2937

Show 1012 earlier messages
  1. waldhacker uploaded patch set 1 02/23/22, 22:24

  2. core-ci voted on patch set 1 V +1 02/23/22, 22:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24156

  3. Björn Jacob updated the commit message in patch set 2 02/24/22, 06:36

  4. Björn Jacob voted on patch set 2 V +1 CR +1 02/24/22, 06:39

  5. core-ci voted on patch set 2 V +1 02/24/22, 06:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24160

  6. Oliver Hader commented on patch set 2 02/24/22, 08:09

    This looks like a perfect candidate for more tests.... ;) * `'label'` * `"label"` * `\'label` * `\"label`
  7. waldhacker commented on patch set 2 CR -1 02/24/22, 08:11

    Reply

    sure ;)
  8. waldhacker marked it work in progress 02/24/22, 08:11

  9. Oliver Hader commented on patch set 2 02/24/22, 08:15

    Oh, and `label: "Demo: Just a 'label'"` also would be a good test case (→ colon)
  10. waldhacker commented on patch set 2 02/24/22, 08:19

    This change is ready for review.

    Reply

    Merci, i will start to write unit tests for it (and fix the code) :)
  11. waldhacker marked it work in progress 02/24/22, 08:19

  12. waldhacker uploaded patch set 3 02/24/22, 09:56

  1. waldhacker marked it ready for review 02/24/22, 10:00

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

  3. Björn Jacob updated the commit message in patch set 4 02/24/22, 10:28

  4. Björn Jacob commented on patch set 4 V +1 CR +1 02/24/22, 10:29

    Applied the optimized commit message again. And tested it again with all the cases mentioned.
  5. Oliver Hader voted on patch set 4 CR -1 02/24/22, 10:42

  6. Oliver Hader marked it work in progress 02/24/22, 10:42

  7. Oliver Hader uploaded patch set 5 02/24/22, 10:46

  8. core-ci voted on patch set 4 V +1 02/24/22, 10:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24174

  9. Oliver Hader commented on patch set 5 CR +1 02/24/22, 10:47

    This change is ready for review.

    FormPersistenceManagerTest.php:593

    Previously quotes from properties other than `label` were trimmed - I don't know, which implications it has when not trimming them anymore...
  10. waldhacker commented on patch set 5 02/24/22, 10:49

    FormPersistenceManagerTest.php:593 Reply

    good point, I check it briefly
  11. Oliver Hader voted on patch set 5 V +1 02/24/22, 10:50

  12. core-ci voted on patch set 5 V -1 02/24/22, 10:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24177

  13. waldhacker uploaded patch set 6 02/24/22, 11:26

  14. waldhacker voted on patch set 6 CR -1 02/24/22, 11:31

  15. waldhacker uploaded patch set 7 02/24/22, 11:32

  16. core-ci voted on patch set 6 V -1 02/24/22, 11:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24181

  17. core-ci voted on patch set 7 V -1 02/24/22, 11:42 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24182

  18. waldhacker uploaded patch set 8 02/24/22, 11:45

  19. core-ci voted on patch set 8 V +1 02/24/22, 11:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24185

  20. Andreas Steiger commented on patch set 8 V +1 CR +1 02/24/22, 15:00

    Works really nice for me 👍
  21. Björn Jacob voted on patch set 8 V +1 CR +1 02/24/22, 15:02

  22. waldhacker commented on patch set 8 02/24/22, 17:25

    FormPersistenceManagerTest.php:593 Reply

    Done
  23. waldhacker commented on patch set 8 02/24/22, 17:25

    Reply

    Done

    Reply

    Done
  24. Oliver Hader voted on patch set 8 V +2 CR +2 02/25/22, 12:45

  25. Oliver Hader merged patch set 9 02/25/22, 12:46