Review main Merged

76444[BUGFIX] Clean up TCA Tree code base

Benni Mack CR +2 V +2 Normal +27 −47 updated 11/06/22, 09:15

Commit message

This change simplifies further
work on the TCA Tree logic.

a) use imported names
b) ensure to use int|string for Node->getId() as Core uses this
   for integers within e.g. sys_category
c) fix some phpdoc infos
d) remove an unused property
e) use proper casting for integers
f) use $this->lookupField instead of $this->getLookupField()
   when using 10000 of categories, this function call is superfluous.

By using int|string, the changed code

  if ($node->getId() !== 0 && $node->getId() !== '0')

saves 1 (!) DB query on every request.

This change is meant also to be backported
to v11, for this reason no changes to the types within properties are
made (only type hints).

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Georg Ringer +1
    • Oliver Klee +1
    • Markus Klein +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Georg Ringer +1
    • Markus Klein +1
    • core-ci +1 CI

Issues 1

Files 5

Review log 1317

  1. Benni Mack uploaded patch set 1 11/05/22, 15:07

  2. core-ci voted on patch set 1 V -1 11/05/22, 15:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33147

  3. Benni Mack uploaded patch set 2 11/05/22, 15:34

  4. core-ci voted on patch set 2 V +1 11/05/22, 15:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33148

  5. Kevin Appelt voted on patch set 2 CR +1 11/05/22, 15:44

  6. Oliver Klee commented on patch set 2 11/05/22, 16:08

    TreeNode.php:119

    Nitpick: For consistency, this should be the other way round: string|int

    DatabaseTreeDataProvider.php:56

    This should stay as this allows PHPStan to have further checks when writing/reading this property.

    DatabaseTreeDataProvider.php:134

    shorter: self::MODE_* (and also drop the int)

    DatabaseTreeDataProvider.php:144

    shorter: self::MODE_* (and also drop the int)
  7. Oliver Klee commented on patch set 2 CR -1 11/05/22, 16:12

    DatabaseTreeDataProvider.php:134 Reply

  8. Benni Mack uploaded patch set 3 11/05/22, 19:22

  9. core-ci voted on patch set 3 V +1 11/05/22, 19:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33150

  10. Oliver Klee commented on patch set 3 CR +1 11/05/22, 19:33

    TreeNode.php:119 Reply

    Done

    DatabaseTreeDataProvider.php:56 Reply

    Done

    DatabaseTreeDataProvider.php:134 Reply

    Done

    DatabaseTreeDataProvider.php:144 Reply

    Done
  11. Benni Mack rebased onto patch set 4 11/05/22, 21:08

  12. core-ci voted on patch set 4 V +1 11/05/22, 21:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33152

  13. Markus Klein voted on patch set 4 V +1 CR +1 11/05/22, 22:13

  14. Oliver Klee voted on patch set 4 CR +1 11/05/22, 23:02

  15. Georg Ringer voted on patch set 4 V +1 CR +1 11/06/22, 05:23

  16. Oli Bartsch voted on patch set 4 V +2 CR +2 11/06/22, 09:15

  17. Oli Bartsch merged patch set 5 11/06/22, 09:15