After upgrade drupal core 7.4 => 7.7 following php notice:

Notice: Undefined index: title in menu_block_get_title() (Zeile 371 von /drupal/sites/all/modules/menu_block/menu_block.module).

and

Notice: Undefined index: primary-links in menu_tree_build() (Zeile 256 von /drupal/sites/all/modules/menu_block/menu_block.module).

Menue block is no display on pages.

Comments

xlyz’s picture

Status: Active » Closed (works as designed)

7.7 core menu name change unset the selected menu.

Go to admin/structure/block, open your block menu configuration page, reselect the menu, save. Fixed :)

2ndmile’s picture

Status: Closed (works as designed) » Active

xlyz... following your steps did not fix the problem. I am still getting the error on Drupal 7.8.

Notice: Undefined index: title in menu_block_get_title() (line 371 of /Applications/MAMP/htdocs/BS/sites/all/modules/menu_block/menu_block.module).

Any other ideas? TIA

EDIT: I am only getting this error on taxonomy pages that are being handled by Views. i.e. taxonomy/term/4. All other page display the menu block with no trouble.

2ndmile’s picture

Status: Active » Closed (fixed)

Going to close this issue again because I found a way to side step. Diving in I discovered that obviously the menu item would not be set for a taxonomy page that is being handled by views, therefore no 'title' index, and therefore the error. My 'fix' was to create menu items for my taxonomy terms as children of the main menu item. While not what I had originally intended... it works and the error is gone because 'title' index is now set.

basvredeling’s picture

Issue summary: View changes

This is also an issue for programmatically created menu items.
how about an extra check?
replace:

$title = array('#markup' => check_plain($menu_item['title']));

with:

if (!array_key_exists('title', $menu_item)) {
  watchdog('menu_block', 'invalid menu item', array(), WATCHDOG_ERROR);
  return FALSE;
}
$title = array('#markup' => check_plain($menu_item['title']));