Review main Merged

83575[BUGFIX] Ensure items array in DataHandler checkValue methods

Nikita Hovratov CR +2 V +2 Easy +18 −7 updated 04/23/24, 06:13

Commit message

It is possible that TCA items array is not set in DataHandler if

1. items is defined through types/*/columnsOverrides
2. DataHandler is triggered with context of another record type
   (e.g. by a translation request)

This patch ensures we are always dealing with an array for items. Also,
when passing it as parameter to
`ItemProcessingService->getProcessingItems`.

Review

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

Issues 1

Files 2

Review log 2024

  1. Nikita Hovratov uploaded patch set 1 03/23/24, 04:05

  2. Nikita Hovratov uploaded patch set 2 03/23/24, 04:07

  3. core-ci voted on patch set 1 V -1 03/23/24, 04:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54865

  4. core-ci voted on patch set 2 V +1 03/23/24, 04:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54866

  5. Oliver Klee voted on patch set 2 CR +1 03/23/24, 09:51

  6. Benni Mack voted on patch set 2 CR +1 V +1 03/24/24, 08:24

  7. Stefan Bürk voted on patch set 2 CR +1 V +1 04/20/24, 22:46

  8. Oli Bartsch commented on patch set 2 04/22/24, 07:43

    Would actually be good to have this somehow covered with a test.
  9. Nikita Hovratov commented on patch set 2 04/22/24, 08:02

    Reply

    I hoped it was enough that other tests didn't break :) Would it suffice to add a single test case, where `items` is not set? Maybe I can have a look in the evening or you could pick this up. No rush though, this is just an edge case.
  10. Oli Bartsch commented on patch set 2 04/22/24, 08:31

    Reply

    Yes a simple test would be totally fine for me.
  11. Oliver Klee commented on patch set 2 04/22/24, 09:29

    Reply

    Wearing my tester hat: As this is a bugfix, the helpful test IMHO would be a regression test, i.e., a test that fails without the fix and that passes with it. All other tests (that test that this change does not break anything) are helpful as well, but more of the "cherry-on-top" class. :-)
  12. Nikita Hovratov uploaded patch set 3 CR +1 V +1 04/22/24, 16:48

  13. Nikita Hovratov commented on patch set 3 04/22/24, 16:49

    Reply

    Done
  14. core-ci voted on patch set 3 V +1 04/22/24, 16:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56501

  15. Oliver Klee voted on patch set 3 V +1 04/22/24, 17:00

  16. Christian Kuhn commented on patch set 3 04/22/24, 21:32

    DataHandler.php:2248

    with the current access pattern it looks safe to claim $res MUST be an array, and the return value is an array, too. Could we change the method signature accordingly and add 'array $res' and ': array' as drive-by?
  17. Christian Kuhn uploaded patch set 4 V +1 04/22/24, 21:42

  18. Christian Kuhn commented on patch set 3 CR +1 V +1 04/22/24, 21:43

    DataHandler.php:2248 Reply

    did that now, but for main only. guess that's ok.
  19. core-ci voted on patch set 4 V +1 04/22/24, 21:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56511

  20. Christian Kuhn voted on patch set 4 CR +1 V +1 04/22/24, 22:00

  21. Stefan Bürk voted on patch set 4 CR +1 V +1 04/22/24, 22:15

  22. Oliver Klee voted on patch set 4 CR +1 V +1 04/22/24, 22:20

  23. Nikita Hovratov voted on patch set 4 CR +2 V +2 04/23/24, 06:13

  24. Nikita Hovratov merged patch set 5 04/23/24, 06:13