Review main Merged

77316[BUGFIX] Do not query database for non-existent records

Markus Klein CR +2 V +2 Easy +11 −15 updated 02/06/23, 16:52

Commit message

Extbase does not ask the database anymore for relations, where the uid
in the database field is zero.

This prevents SQL queries with where-parts like `uid IN (0)`.

Since this is done when reconstituting models from the database,
depending on the amount of relations of a model, the number of saved
queries is huge.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Stephan Großberndt +1
    • Stefan Froemken +1
    • Andreas Kienast +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Stephan Großberndt +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 2022

  1. Markus Klein uploaded patch set 1 01/10/23, 12:31

  2. Georg Ringer voted on patch set 1 V +1 CR +1 01/10/23, 12:38

  3. core-ci voted on patch set 1 V +1 01/10/23, 12:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/35644

  4. Stephan Großberndt voted on patch set 1 V +1 CR +1 01/10/23, 12:43

  5. Stefan Froemken commented on patch set 1 01/10/23, 12:58

    DataMapper.php:580

    Just a nice to have: Can you please merge the if with the else? THX
  6. Christian Kuhn voted on patch set 1 CR -1 01/10/23, 13:04

  7. Markus Klein commented on patch set 1 01/10/23, 13:08

    DataMapper.php:580 Reply

    I'll wait for more feedback and will eventually do this too then.
  8. Christian Kuhn voted on patch set 1 CR 0 01/10/23, 13:19

  9. Stefan Froemken voted on patch set 1 CR +1 01/10/23, 13:25

  10. Christian Kuhn commented on patch set 1 01/10/23, 13:35

    Unsure about v11 from a risk assessment point of view, but I'd definitely skip v10. Other than that, it looks good from digging into the code.
  11. Markus Klein uploaded patch set 2 CR +1 V +1 01/10/23, 13:40

  12. Markus Klein commented on patch set 1 01/10/23, 13:40

    DataMapper.php:580 Reply

    Done
  13. Christian Kuhn voted on patch set 2 CR +1 01/10/23, 13:41

  14. core-ci voted on patch set 2 V +1 01/10/23, 13:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/35647

  15. Stefan Froemken voted on patch set 2 CR +1 01/10/23, 14:06

  16. Stephan Großberndt voted on patch set 2 V +1 CR +1 01/10/23, 16:27

  17. Oliver Hader commented on patch set 2 01/11/23, 08:15

    DataMapper.php:342

    What about changing this to `empty($fieldValue)` as well?
  18. Markus Klein commented on patch set 2 01/11/23, 08:52

    DataMapper.php:342 Reply

    I tried this, and thought about it, but didn't dare, because: This code path is also executed for other relation types. If inline fields contain the number of records or so. It shouldn't matter at this point. I actually doubt that this condition is ever true, once this patch is applied in its current form.
  19. Andreas Kienast voted on patch set 2 CR +1 02/06/23, 16:44

  20. Christian Kuhn voted on patch set 2 V +2 CR +2 02/06/23, 16:44

  21. Christian Kuhn commented on patch set 2 02/06/23, 16:45

    DataMapper.php:342 Reply

    Ack
  22. Christian Kuhn merged patch set 3 02/06/23, 16:52