Review main Merged

84339[BUGFIX] Guard array key access in `SetupModuleController`

Ziad Abdul Hai CR +2 V +2 Easy +2 −2 updated 06/05/24, 15:10

Commit message

Prevent an undefined array key warning in case
a non-admin-user save his profile with disabled
avatar field, for example with

  setup.fields.avatar.disabled=1

Review

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

Issues 1

Files 1

Review log 1620

  1. Ziad Abdul Hai uploaded patch set 1 05/22/24, 05:48

  2. Andreas Kienast voted on patch set 1 CR +1 05/22/24, 05:53

  3. core-ci voted on patch set 1 V +1 05/22/24, 05:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58033

  4. Garvin Hicking commented on patch set 1 05/22/24, 05:56

    SetupModuleController.php:299

    I am wondering, that would overwrite an avatar field with "0" - so it gets lost, just because one user has the field not shown. Maybe better to check if the variable is set and only then call the setAvatarFileuid method, what do you think?
  5. Andreas Kienast commented on patch set 1 05/22/24, 05:59

    SetupModuleController.php:299 Reply

    That's not true. The method `setAvatarFileUid()` checks for an "empty" `$fileUid` and aborts then.
  6. Stefan Bürk updated the commit message in patch set 2 CR +1 V +1 05/22/24, 06:05

  7. Garvin Hicking commented on patch set 2 CR +1 05/22/24, 06:06

    SetupModuleController.php:299 Reply

    Ah, thanks, didn't check the code contained there, sorry for the noise.
  8. core-ci voted on patch set 2 V +1 05/22/24, 06:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58035

  9. Willi Wehmeier voted on patch set 2 CR +1 05/22/24, 06:14

  10. Andreas Kienast voted on patch set 2 CR +1 05/22/24, 06:15

  11. Andreas Kienast voted on patch set 2 V +1 05/22/24, 06:47

  12. Stefan Bürk commented on patch set 2 05/22/24, 07:37

    SetupModuleController.php:299

    I would prefere here to use `?? null` as fallback to emphasize the "not given" state more and additionally change the annotatin method `setAvatarFileUid` that nullable file uid is possible (and in place for later making it native typed).

    SetupModuleController.php:839

    I would add ``` * @param int|null $fileUid ``` to the method docblock with some description for that parameter
  13. Georg Ringer commented on patch set 3 CR +1 V +1 05/29/24, 04:55

    Published edit on patch set 2.
  14. core-ci voted on patch set 3 V -1 05/29/24, 05:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58433

  15. Georg Ringer commented on patch set 4 V -1 05/30/24, 06:34

    Published edit on patch set 3.
  16. core-ci voted on patch set 4 V +1 05/30/24, 06:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58474

  17. Christian Kuhn commented on patch set 4 CR +1 V +1 06/05/24, 14:40

    SetupModuleController.php:299 Reply

    Done

    SetupModuleController.php:839 Reply

    Done
  18. Stefan Bürk voted on patch set 4 CR +1 V +1 06/05/24, 14:43

  19. Christian Kuhn voted on patch set 4 CR +2 V +2 06/05/24, 15:10

  20. Christian Kuhn merged patch set 5 06/05/24, 15:10