Review main Merged

91843[TASK] Avoid invalid dropdown button in module menu processing

Garvin Hicking CR +2 V +2 Easy +11 −1 updated 11/24/25, 14:34

Commit message

Previously, the menu was rendered as a <select>,
which meant the first or currently selected <option>
acted as the visible label. The menu itself had no
separate label.

As a fallback, we now use the first menu item title
as the button label, ensuring the DropDownButton is
valid. The button will still always display the active
item, because setShowActiveLabelText(true) is set.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Oli Bartsch +1
    • Markus Klein +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Oli Bartsch +1
    • Markus Klein +1
    • core-ci +1 CI

Issues 2

Files 1

Review log 1724

  1. Garvin Hicking uploaded patch set 1 11/24/25, 08:24

  2. Markus Klein voted on patch set 1 CR +1 V +1 11/24/25, 08:26

  3. Markus Klein commented on patch set 1 11/24/25, 08:26

    DocHeaderComponent.php:477

    maybe a bit stronger check with $label === ''? (so we allow "0")
  4. core-ci voted on patch set 1 V +1 11/24/25, 08:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/90799

  5. Oli Bartsch commented on patch set 1 11/24/25, 08:39

    ```suggestion This was fine in v12+v13, but breaks in v14 because no ```

    DocHeaderComponent.php:477 Reply

    Yes please, $label can only be string and we should therefore use strict comparison.

    DocHeaderComponent.php:478

    The underlying reason is this: Previously, the menu was rendered as a <select>, so the first <option> was shown automatically and there was no separate "label" for the menu itself. That implicit behavior is what changed. I would like this to be described more clearly, because right now it is not obvious what exactly changed or why. Also, it still looks as if this could fail when non of the. menuItems got a title, but the title is actually mandatory for them.
  6. Garvin Hicking uploaded patch set 2 CR +1 V +1 11/24/25, 08:45

  7. Garvin Hicking commented on patch set 2 11/24/25, 08:45

    Reply

    Done

    DocHeaderComponent.php:477 Reply

    Done

    DocHeaderComponent.php:478 Reply

    Done
  8. core-ci voted on patch set 2 V -1 11/24/25, 09:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/90803

  9. Oli Bartsch commented on patch set 2 11/24/25, 10:19

    DocHeaderComponent.php:495

    AFAICS this replaces any set label now. And this is not needed at all. menuItem->getTitle() must return a non empty string, otherwise it would not be part of the getMenuItems() and we have at least 2 valid items at this point, see early return in line 467.
  10. core-ci commented on patch set 2 11/24/25, 10:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/90803

  11. Garvin Hicking commented on patch set 3 V -1 11/24/25, 11:13

    Published edit on patch set 2.
  12. Garvin Hicking commented on patch set 4 11/24/25, 11:14

    Published edit on patch set 3.
  13. Garvin Hicking commented on patch set 4 11/24/25, 11:15

    DocHeaderComponent.php:495 Reply

    Yes. Don't know why I did that. Brain still not working. :-(
  14. core-ci voted on patch set 3 V +1 11/24/25, 11:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/90820

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

  16. Oli Bartsch uploaded patch set 5 V +1 11/24/25, 11:59

  17. Oli Bartsch commented on patch set 5 CR +1 V +1 11/24/25, 12:00

    DocHeaderComponent.php:495 Reply

    Done
  18. Oli Bartsch updated the commit message in patch set 6 CR +1 V +1 11/24/25, 12:02

  19. Oli Bartsch voted on patch set 6 CR +1 V +1 11/24/25, 12:02

  20. core-ci voted on patch set 5 V +1 11/24/25, 12:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/90827

  21. core-ci voted on patch set 6 V +1 11/24/25, 12:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/90828

  22. Markus Klein voted on patch set 6 CR +1 V +1 11/24/25, 14:33

  23. Garvin Hicking voted on patch set 6 CR +2 V +2 11/24/25, 14:34

  24. Garvin Hicking merged patch set 7 11/24/25, 14:34