Review main Merged

88330[TASK] Refactor DataHandler->moveRecord_raw()

Christian Kuhn CR +2 V +2 Hard +174 −325 updated 02/26/25, 18:26

Commit message

After juggling moveRecord() and moveRecord_raw() for three days,
the code is better tamed, more easy to follow and grasp, with
fewer lines of code.

* moveRecord_raw() becomes obsolete by integrating it into
  moveRecord().
* getRecordProperties() finally bites the dust.
* moveRecord_procBasedOnFieldType() is merged into
  moveRecord_procFields().
* resolvePid() is simplified and will most likely become
  unused soon.
* history "logging" data is improved: The existing solution did
  not write good "oldData". Rollback of moved record still does
  not work, but that is a second issue in HistoryController, not
  in DataHandler.

Removed methods that are still public in v13 will remain in the
v13 backport, but moved to the end of the class and marked unused.

The patch makes moveRecord() lengthy, but it splits into sections
that take care of preparation, fact gathering, data preparation,
permission checking and finally main move handling. The code is
not yet in a truly "clean" state, there is still room for further
improvements. Further iterations should be more easy to review.

The change saves a few queries again. To get an idea of the current
state, I measured query count of functional test
DataScenarios/Regular/{Modify|WorkspacesModify}/ActionTest.php
"movePageToDifferentPageTwice". "Before checkpoint" is git commit
eb7776ab2b35ebb49efe2088c17709b500522880, a commit before the
current series of DataHandler improvements.

Before: Modify: 739; WorkspacesModify 1555
With patch: Modify 469; WorkspacesModify 934

The absolute numbers don't say much (and mysql probably counts
each "true" query twice due to sql preparation, unsure).
But we can see these patches not only make more DataHandler
code maintainable, but also improve performance. For move, we
shaved off about 1/3 of queries already, other operations
got some share as well. There is potential for much more.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • Benni Mack +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 4

Files 1

Review log 3464

Show 2039 earlier messages
  1. Christian Kuhn uploaded patch set 1 02/24/25, 17:08

  2. core-ci voted on patch set 1 V +1 02/24/25, 17:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74629

  3. Christian Kuhn uploaded patch set 2 V +1 02/24/25, 17:53

  4. core-ci voted on patch set 2 V +1 02/24/25, 17:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74632

  5. Christian Kuhn uploaded patch set 3 V +1 02/24/25, 18:04

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

  7. Christian Kuhn uploaded patch set 4 V +1 02/24/25, 19:07

  8. core-ci voted on patch set 4 V +1 02/24/25, 19:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74635

  9. Christian Kuhn uploaded patch set 5 V +1 02/24/25, 19:14

  10. core-ci voted on patch set 5 V +1 02/24/25, 19:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74636

  11. Christian Kuhn uploaded patch set 6 V +1 02/24/25, 19:21

  12. core-ci voted on patch set 6 V +1 02/24/25, 19:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74637

  13. Christian Kuhn uploaded patch set 7 V +1 02/25/25, 17:41

  14. core-ci voted on patch set 7 V +1 02/25/25, 17:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74692

  15. Christian Kuhn uploaded patch set 8 V +1 02/25/25, 17:49

  16. Christian Kuhn uploaded patch set 9 02/25/25, 17:52

  17. Christian Kuhn uploaded patch set 10 02/25/25, 17:55

  18. core-ci voted on patch set 8 V +1 02/25/25, 17:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74693

  19. core-ci voted on patch set 9 V +1 02/25/25, 17:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74694

  20. core-ci voted on patch set 10 V +1 02/25/25, 18:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74695

  21. Christian Kuhn uploaded patch set 11 V +1 02/25/25, 19:14

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

  23. Christian Kuhn uploaded patch set 12 V +1 02/25/25, 20:11

  24. core-ci voted on patch set 12 V +1 02/25/25, 20:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74701

  25. Christian Kuhn uploaded patch set 13 V +1 02/25/25, 20:55

  26. core-ci voted on patch set 13 V +1 02/25/25, 21:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74705

  27. Christian Kuhn uploaded patch set 14 V +1 02/25/25, 21:11

  28. core-ci voted on patch set 14 V +1 02/25/25, 21:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74706

  29. Christian Kuhn uploaded patch set 15 V +1 02/25/25, 21:41

  30. core-ci voted on patch set 15 V -1 02/25/25, 21:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74707

  31. Christian Kuhn uploaded patch set 16 V -1 02/26/25, 07:57

  32. core-ci voted on patch set 16 V +1 02/26/25, 08:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74730

  33. Christian Kuhn uploaded patch set 17 V +1 02/26/25, 10:13

  34. core-ci voted on patch set 17 V +1 02/26/25, 10:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74744

  35. Christian Kuhn uploaded patch set 18 V +1 02/26/25, 10:24

  36. Christian Kuhn uploaded patch set 19 02/26/25, 10:28

  37. core-ci voted on patch set 18 V +1 02/26/25, 10:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74748

  38. core-ci voted on patch set 19 V +1 02/26/25, 10:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74750

  39. Christian Kuhn uploaded patch set 20 V +1 02/26/25, 10:45

  1. core-ci voted on patch set 20 V +1 02/26/25, 10:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74752

  2. Christian Kuhn uploaded patch set 21 V +1 02/26/25, 12:20

  3. core-ci voted on patch set 21 V +1 02/26/25, 12:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74755

  4. Christian Kuhn uploaded patch set 22 V +1 02/26/25, 12:26

  5. core-ci voted on patch set 22 V +1 02/26/25, 12:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74756

  6. Christian Kuhn uploaded patch set 23 V +1 02/26/25, 13:50

  7. core-ci voted on patch set 23 V +1 02/26/25, 13:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74763

  8. Christian Kuhn uploaded patch set 24 V +1 02/26/25, 14:01

  9. core-ci voted on patch set 24 V +1 02/26/25, 14:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74764

  10. Christian Kuhn uploaded patch set 25 V +1 02/26/25, 14:11

  11. core-ci voted on patch set 25 V -1 02/26/25, 14:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74766

  12. Christian Kuhn uploaded patch set 26 V -1 02/26/25, 14:37

  13. core-ci voted on patch set 26 V +1 02/26/25, 14:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74767

  14. Christian Kuhn updated the commit message in patch set 27 V +1 02/26/25, 15:40

  15. Christian Kuhn updated the commit message in patch set 28 02/26/25, 15:47

  16. core-ci voted on patch set 27 V +1 02/26/25, 15:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74776

  17. core-ci voted on patch set 28 V +1 02/26/25, 15:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74778

  18. Christian Kuhn updated the commit message in patch set 29 V +1 02/26/25, 15:55

  19. Christian Kuhn updated the commit message in patch set 30 02/26/25, 15:55

  20. core-ci voted on patch set 29 V +1 02/26/25, 16:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74780

  21. core-ci voted on patch set 30 V +1 02/26/25, 16:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74781

  22. Stefan Bürk voted on patch set 30 CR +1 V +1 02/26/25, 17:12

  23. Benni Mack voted on patch set 30 CR +1 V +1 02/26/25, 17:55

  24. Christian Kuhn voted on patch set 30 CR +2 V +2 02/26/25, 18:00

  25. Christian Kuhn merged patch set 31 02/26/25, 18:26