Review main Merged

94699[TASK] Throw error when DocHeaderComponent has multiple menus

Garvin Hicking CR +2 V +2 Normal +199 −0 updated 07/21/26, 07:51

Commit message

With #107875 the DocHeaderComponent was introduced and featured
streamlined submenu creation.

The assumption was, that backend modules would not contain
multiple DocHeaderComponents next to each other, allowing
to add another level of nesting to a backend module.

This edge case was silently filtered out and resulted in
the unexpected result of only having the first menu
rendered, when in reality the MenuRegistry allowed to
attach multiple menus just fine (for other use cases).

With this patch, the compilation of the DocHeaderComponent
is tightened.

In v15 it now throws an exception hinting at
better not creating nested menu levels, but instead either
using proper submodules, or adding custom dropdown menu
items for functionality. In v14 only a warning will
be logged, giving context to the place where this
occurred.

Given the edge-case scenario and expected rare usage,
this is not considered a breaking change in v15
warranting a changelog entry.

For UI/UX reasons, TYPO3 v14 streamlined the module display
so that only one secondary menu bar is expected.

Missing tests for the DocHeaderComponent and MenuRegistry
are added to fixate the behavior.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Oli Bartsch +1
    • Oliver Klee +1
    • Josua Vogel +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Oli Bartsch +1
    • Oliver Klee +1
    • Josua Vogel +1
    • core-ci +1 CI

Issues 2

Files 3

Review log 1722

  1. Garvin Hicking uploaded patch set 1 07/07/26, 19:16

  2. core-ci voted on patch set 1 V -1 07/07/26, 19:23 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104483

  3. Garvin Hicking uploaded patch set 2 V -1 07/07/26, 19:27

    fix test phpstan
  4. core-ci voted on patch set 2 V +1 07/07/26, 19:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104484

  5. Jan Kornblum voted on patch set 2 CR +1 V +1 07/07/26, 20:06

  6. Garvin Hicking commented on patch set 2 07/07/26, 20:14

    (Not sure yet what is the best approach. Maybe logging an error instead of failing, so graceful execution can still continue?)
  7. Josua Vogel commented on patch set 2 07/08/26, 06:38

    Reply

    If only one menu is allowed, shouldn't the API be restricted so that you can't add multiple menus? The current solution isn't really ideal.
  8. Garvin Hicking updated the commit message in patch set 3 CR +1 V +1 07/08/26, 07:19

  9. Garvin Hicking commented on patch set 3 07/08/26, 07:21

    Reply Unresolved

    The point here is that MenuRegistry can be used in other places then the DocHeaderComponent. So IMO it could be valid to store multiple menus in the Registry itself, but make the consumers themself bail out of utilizing multiple menus in that context. I've contacted Oli and now only "main" throws an exception, and "v14" backport would just logg a warning. For now I don't think adding a changelog entry for this or considering it a breaking change is warranted, but open to discussion about this of course.
  10. core-ci voted on patch set 3 V +1 07/08/26, 07:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104504

  11. Oliver Klee voted on patch set 3 CR +1 V +1 07/08/26, 07:32

  12. Oliver Klee updated the commit message in patch set 4 CR +1 V +1 07/08/26, 07:33

  13. Oliver Klee voted on patch set 4 CR +1 V +1 07/08/26, 07:33

  14. core-ci voted on patch set 4 V +1 07/08/26, 07:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104506

  15. Josua Vogel voted on patch set 4 CR +1 V +1 07/08/26, 07:48

  16. Garvin Hicking commented on patch set 5 CR +1 V +1 07/08/26, 09:45

    Published edit on patch set 4.
  17. Oliver Klee voted on patch set 5 CR +1 V +1 07/08/26, 09:53

  18. core-ci voted on patch set 5 V +1 07/08/26, 09:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104513

  19. Josua Vogel voted on patch set 5 CR +1 V +1 07/10/26, 16:59

  20. Oli Bartsch voted on patch set 5 CR +1 V +1 07/21/26, 07:47

  21. Garvin Hicking voted on patch set 5 CR +2 V +2 07/21/26, 07:51

  22. Garvin Hicking merged patch set 6 07/21/26, 07:51