Problem/Motivation

It is unclear from the standard blocks administration page how to delete a menu block. It is also not clearly shown on the blocks administration page that menu blocks are created and to a large extent managed by the menu system.

Proposed resolution

Nothing concrete yet. Current suggestions:

1. Link to the delete page to the menu itself

- There is no precedent for cross-linking administration pages like this in core.

2. Change the way blocks are created by the menu system

- Doesn't really address the OP's concern directly
- Great if you're the same person creating and deleting the block. Solves nothing if you are inheriting the site from somebody else

3. Make it clearer on the blocks administration screen that the block has been provided by the menu system

- Not totally clear how this would look in the UI yet

Remaining tasks

Decide on a proposed solution

User interface changes

There will be some minor changes to the way the block and menu system is presented to administrators

API changes

Potentially adding the ability to have menus without corresponding blocks

Original report by @budda

When a new menu is created it auto generates a block item on the ?q=admin/block page.
This page doesn't make it clear what type of block this is, so some people might be confused about how to delete the block.

In the block 'Operations' column a 'delete' link for menu blocks could be provided and simply link to ?q=admin/menu/item/delete/<<block-menuid>>

This integrated everything a little better.

CommentFileSizeAuthor
#8 33122-8.patch4.6 KBJody Lynn
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ricabrantes’s picture

Version: x.y.z » 7.x-dev

This is active??

greg.harvey’s picture

Maybe the "configure" link could pull in the edit menu form too, so you don't have to go somewhere else to edit the menu while you're working in the Blocks page?

tstoeckler’s picture

Version: 7.x-dev » 8.x-dev

For edit that doesn't work, because then there would be now way to configure the block title or the block visibility. I don't know whether this whole thing is a good idea, it establishes a pattern that's not used anywhere in core. And letting contrib modules handle their own block deletion patterns could (possibly) open up a whole other can of worms.

Moving to 8.x

Jody Lynn’s picture

Title: Easy delete a menu block » Settings for menu block creation
Component: block.module » menu.module

I feel that the real issue is that menu module shouldn't create a new block for every menu with no way to prevent that. There should be a per-menu setting on menus for whether there should be a corresponding block.

rv0’s picture

@ Jody Lynn
I totally agree

By default, Menu should not create any blocks unless the user specifically asks for it.
Now the block admin gui gets cluttered with unused blocks, which are irrelevant when people use things like menu_block, og_menu.

A simple "Create block for this menu" setting would suffice.

rv0’s picture

Title: Settings for menu block creation » Add "Expose this menu as block" setting

"Expose this menu as block" would be the appropriate wording.
I suggest it would be on by default for the standard menus, but off when creating a new menu.

Changed title as it seems more descriptive.

tstoeckler’s picture

Just for the record, I am -1 on this. I think it is quite a nice feature to have, that the blocks are created automatically.
Unsubscribing.

Jody Lynn’s picture

Status: Active » Needs review
FileSize
4.6 KB

Patch includes upgrade path but no new tests for this feature.

I defaulted all menus to have the 'expose as block' on, to be conservative. I think the main use for turning it off would be programmatic menu creation or developers outputting menus in other ways. Turning it off for 'primary links' in bartik would be a good idea though.

thedavidmeister’s picture

Title: Add "Expose this menu as block" setting » It is unclear how to delete a menu block from the block administration pages
Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs reroll

patch no longer applies:

tdm:d8 thedavidmeister$ git apply 33122-8.patch 
error: core/modules/menu/menu.admin.inc: No such file or directory
error: core/modules/menu/menu.install: No such file or directory
error: core/modules/menu/menu.module: No such file or directory
error: patch failed: core/modules/system/system.module:2107
error: core/modules/system/system.module: patch does not apply

If we're going to take this approach, can we get a bit more discussion around why you would want a menu that does not have a block. I don't think that "Contrib modules provide better menu blocks" is a strong use-case for Core providing this new functionality. Realistically, if the maintainers of those contrib modules were bothered by "duplicate" menu blocks in the system, they'd hide the Core blocks themselves as they present new ones.

Perhaps more concerning though is that this patch seems to miss the fundamental concern of the OP which is clearly:

When a new menu is created it auto generates a block item on the ?q=admin/block page.
This page doesn't make it clear what type of block this is, so some people might be confused about how to delete the block.

Changing the way a block is created originally does nothing to make the UI at admin/block clearer for block deletion.

May I suggest that a way forward could be to show more clearly in the blocks UI that a block is managed by the menu system?

ellanab’s picture

Looks like this issue is fixed. A delete button has been added to the block administration page on a per block basis.

thedavidmeister’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.