That is not common issue and most of menus working fine, but for some of them I have got this:

Notice: Undefined index: menu-produktmeny in menu_tree_build() (line 304 of menu_block.module
Notice: Undefined index: title in menu_block_get_title() (line 413 of menu_block.module

Patch attached in case if somebody has similar issue...

Comments’s picture

This is the last patch but can be applied to:
Menu Block 7.x-2.3

bobodrone’s picture

Issue summary: View changes
968 bytes

Removed full path to module file in patch.

// BoboDrone

yerlix’s picture

I've had the same issue with version 2.4, so I first tried this patch, but with no success.

Then I've used the code from this patch, to create a patch for version 2.4.
This patch can be found here:

Dave Reid’s picture

Status: Active » Needs review
Related issues: +#2349407: Undefined index in menu_tree_build()
1.43 KB
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es). View

I actually think having the PHP notice is a *good* thing since it needs to be addressed. This is the same as core's menu_block_view() which throws the same PHP notice. But we can prevent further errors too with this patch.

Also note that #2419523: Add menu_block_delete() API and respond to menu deletion will prevent this from happening with core block module if you delete a menu being used with a menu block, but it won't do anything if you're using a menu block as a CTools content type plugin (Panels or Panelizer).

Dave Reid’s picture

74.29 KB
2.13 KB
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es). View

Screenshot of a Panel admin page that has both a core block menu, and a menu block menu that both are configured to display a menu that has been deleted. I think this is an appropriate solution.

Dave Reid’s picture

Status: Needs review » Fixed

Tested and committed #5 to 7.x-2.x.

  • Dave Reid committed b4280bd on 7.x-2.x
    Issue #1978528 by Dave Reid, omasjuan, bobodrone, babruix, yerlix: Fixed...

  • Dave Reid committed b4280bd on 7.x-3.x
    Issue #1978528 by Dave Reid, omasjuan, bobodrone, babruix, yerlix: Fixed...

Status: Fixed » Closed (fixed)

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