Problem/Motivation

Menu blocks are being rendered, even if the menu has no items. This is not a problem in every scenario, but when rendered in a region which has paddings, the paddings will create odd spacings.

Steps to reproduce

Just place a group menu block somewhere, in the frontend the block can be found in the rendered html.

Proposed resolution

If the menu tree is empty, return a clean build.

Command icon 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

hydra created an issue. See original summary.

hydra changed the visibility of the branch 3575180-menu-blocks-are to hidden.

hydra’s picture

Not sure if this is the best solution, but in my tests the menu still worked fine by early returning the build.

heddn’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

I'm pretty sure this came up before and we fixed this in a previous iteration. Or if we didn't, there was something relatively similar. I'm tagging for needs tests so we catch this.