Problem/Motivation
When placing/rendering an ogmenu_block on a Layout Builder page (e.g. /admin/structure/types/manage/{bundle}/display/full/layout), OG context may resolve without a persisted group entity ID. OgMenuBlock::build() still tries to generate entity.ogmenu_instance.create with og_group => '', which triggers:
Symfony\Component\Routing\Exception\InvalidParameterException: Parameter "og_group" for route "entity.ogmenu_instance.create" must match "[^/]++" ("" given)
This causes a 500 AJAX error and can break rendering of the layout page.
Expected behaviour:
- Block should not attempt to build the “Add menu” create link when OG context is missing/unsaved.
- Page should render without fatal errors.
Proposed resolution
In OgMenuBlock::build(), guard create-link route generation behind a check that context is an entity with a non-empty ID.
Issue fork og_menu-3575559
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
joelpittetComment #4
joelpittetComment #5
joelpittetComment #6
joelpittetFixed (tests are red/green)