Review main Merged

81472[TASK] Avoid traverseFlexFormXMLData() in cleanup:flexforms

Christian Kuhn CR +2 V +2 Hard +536 −120 updated 10/20/23, 11:19

Commit message

FlexFormTools->cleanFlexFormXML() is only used by CLI
cleanup:flexforms. traverseFlexFormXMLData() is used
as recursive worker method.

FlexForms are not recursive anymore since v7/v8: The
data structure allows sheets with elements. An element
is either a single field, or a section that can have
containers, which can have single field elements again.
Section containers can not be nested.

This allows us to transform cleanFlexFormXML() into
some nested foreachs handling single field and section
container data directly, avoiding a recursion.

This avoids a usage of the traverseFlexFormXMLData()
method, which is very hard to understand and suffers
from an ugly API with its callback approach.

The rewritten implementation of cleanFlexFormXML() is
now covered with tests and takes care of some other
details like the '_TOGGLE' expand/collapse UI artefact
in flex form data. Also, the "renumber" strategy for
section containers has been dropped since it fits no
practical purpose and just increases the number of
records cleanup:flexforms wants to "fix".

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Anja Leichsenring +1
    • Stefan Bürk +1
    • Nikita Hovratov +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Oliver Klee +1
    • Anja Leichsenring +1
    • Stefan Bürk +1
    • Nikita Hovratov +1
    • core-ci +1 CI

Issues 1

Files 11

Review log 1318

  1. Christian Kuhn uploaded patch set 1 10/18/23, 16:22

  2. Christian Kuhn uploaded patch set 2 10/18/23, 16:27

  3. core-ci voted on patch set 2 V -1 10/18/23, 16:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47917

  4. core-ci voted on patch set 1 V -1 10/18/23, 16:38 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47916

  5. Christian Kuhn uploaded patch set 3 V -1 10/19/23, 08:52

  6. core-ci voted on patch set 3 V -1 10/19/23, 08:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47930

  7. Christian Kuhn uploaded patch set 4 V -1 10/20/23, 09:22

  8. core-ci voted on patch set 4 V +1 10/20/23, 09:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47962

  9. Christian Kuhn uploaded patch set 5 V +1 10/20/23, 10:09

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

  11. Oliver Klee commented on patch set 5 10/20/23, 10:50

    Do the tests make sense without the change as well? If so, maybe we can have them in a pre-patch that we also backport to 12.4 (and maybe also to 11.5).
  12. Stefan Bürk voted on patch set 5 V +1 CR +1 10/20/23, 10:52

  13. Christian Kuhn commented on patch set 5 10/20/23, 10:53

    Reply

    they don't work directly since the new implementation does better error handling, and details like the _TOGGLE things are not covered by previous implementation. thus: no pre-patch.
  14. Oliver Klee voted on patch set 5 V +1 10/20/23, 11:00

  15. Nikita Hovratov voted on patch set 5 V +1 CR +1 10/20/23, 11:12

  16. Anja Leichsenring voted on patch set 5 V +1 CR +1 10/20/23, 11:18

  17. Christian Kuhn voted on patch set 5 V +2 CR +2 10/20/23, 11:19

  18. Christian Kuhn merged patch set 6 10/20/23, 11:19