Review main Merged

89732[BUGFIX] Streamline type of buttons within backend button bar

Elias Häußler CR +2 V +2 Easy +14 −6 updated 06/17/25, 17:46

Commit message

The buttons added to the backend button bar can be modified through a
`ModifyButtonBarEvent`. Buttons, which were initially added to the
button bar using the `ButtonBar::addButton` method, are sorted by
position and group. This array structure was not properly reflected in
the `ModifyButtonBarEvent`, which is now fixed by introducing a
dedicated PHPStan type for the rather complex array structure.

Review

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

Issues 1

Files 2

Review log 1113

  1. Elias Häußler uploaded patch set 1 06/15/25, 11:33

  2. Elias Häußler uploaded patch set 2 06/15/25, 11:36

  3. core-ci voted on patch set 1 V -1 06/15/25, 11:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80342

  4. core-ci voted on patch set 2 V +1 06/15/25, 11:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80343

  5. Oliver Klee voted on patch set 2 CR +1 V +1 06/15/25, 11:53

  6. Georg Ringer commented on patch set 2 CR -1 06/16/25, 05:21

    ButtonBar.php:49

    why not array<ButtonInterface>?

    ModifyButtonBarEvent.php:28

    IMO this is correct

    ModifyButtonBarEvent.php:33

    not needed, we got a return type already

    ModifyButtonBarEvent.php:41

    not needed, we got a return type already
  7. Georg Ringer voted on patch set 2 CR 0 06/16/25, 05:21

  8. Elias Häußler commented on patch set 2 06/16/25, 05:36

    ButtonBar.php:49 Reply

    `Buttons` is a custom PHPStan type (see line 32) which is used here. I did this to avoid repeating the rather complex array structure at every place. I think this may also answer your other comments.
  9. Georg Ringer voted on patch set 2 CR +1 V +1 06/16/25, 19:21

  10. Markus Klein commented on patch set 2 CR +1 V +1 06/17/25, 06:37

    ButtonBar.php:49 Reply

    Done

    ModifyButtonBarEvent.php:28 Reply

    Done

    ModifyButtonBarEvent.php:33 Reply

    Done

    ModifyButtonBarEvent.php:41 Reply

    Done
  11. Christian Kuhn voted on patch set 2 CR +1 06/17/25, 10:30

  12. Christian Kuhn commented on patch set 2 CR +2 V +2 06/17/25, 16:34

    i'll gonna merge this when v13 and v12 are green. note i'd usually not accept this for v12 anymore. however, considering the change is (nearly) completely comment-only and thus low-risk, i'll accept the v12 request in this case.
  13. Christian Kuhn merged patch set 3 06/17/25, 17:46