Review main Merged

91628[BUGFIX] Avoid array access warning in EditDocumentController

Torben Hansen CR +2 V +2 Easy +4 −13 updated 11/14/25, 12:25

Commit message

With #107794, method call `setIsSavedRecord()` has been moved
from `getButtons()` to the `main()`. The method is now always
called and requires better sanitizing to avoid array key
access warnings. To simplify things, `setIsSavedRecord()` is
inlined to `main()` directly.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Oliver Klee +1
    • Oliver Hader +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • core-ci +1 CI

Issues 2

Files 1

Review log 1822

  1. Torben Hansen uploaded patch set 1 11/13/25, 18:11

  2. core-ci voted on patch set 1 V +1 11/13/25, 18:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89562

  3. Oli Bartsch voted on patch set 1 CR +1 V +1 11/13/25, 19:45

  4. Lina Wolf commented on patch set 1 11/13/25, 19:54

    EditDocumentController.php:1266

    Can we be sure the array indexes are alway set? how about `$this->firstEl['cmd']??''`
  5. Torben Hansen commented on patch set 1 11/13/25, 20:15

    EditDocumentController.php:1266 Reply

    No, $this->firstEl can also be null (see in main function), so the suggested check is not sufficient.
  6. Lina Wolf voted on patch set 1 CR +1 V +1 11/13/25, 21:22

  7. Oliver Klee commented on patch set 1 11/13/25, 22:58

    EditDocumentController.php:1265

    As the property is not an boolean, I'd suggest we do a type check instead: ```suggestion is_array($this->firstEl) && ```
  8. Christian Kuhn uploaded patch set 2 CR +1 V +1 11/14/25, 01:41

  9. Christian Kuhn commented on patch set 2 CR +1 V +1 11/14/25, 01:41

    let's inline that one-liner along the way to avoid the confusing method name.

    EditDocumentController.php:1265 Reply

    Done
  10. core-ci voted on patch set 2 V -1 11/14/25, 01:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89618

  11. Christian Kuhn uploaded patch set 3 CR +1 V +1 11/14/25, 02:23

  12. Christian Kuhn voted on patch set 3 CR +1 V +1 11/14/25, 02:23

  13. Christian Kuhn commented on patch set 3 11/14/25, 02:24

    ... we will have to clean up this messy controller at some point ...
  14. core-ci voted on patch set 3 V +1 11/14/25, 02:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89625

  15. Benni Mack commented on patch set 3 11/14/25, 07:41

    serious question: "what's sanitation" - do you mean "sanitization"?
  16. Oliver Klee voted on patch set 3 CR +1 11/14/25, 08:58

  17. Oliver Klee updated the commit message in patch set 4 CR +1 V +1 11/14/25, 08:59

  18. Oliver Klee commented on patch set 4 CR +1 11/14/25, 09:00

    Reply

    The way I read the code, "sanitization" or "sanitizing" would match the behavior. I've updated the wording accordingly.
  19. core-ci voted on patch set 4 V +1 11/14/25, 09:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89670

  20. Christian Kuhn voted on patch set 4 CR +2 V +2 11/14/25, 10:52

  21. Christian Kuhn merged patch set 5 11/14/25, 10:52

  22. Oliver Hader voted on patch set 5 CR +1 11/14/25, 12:25