On some pages I get this error two times.
After some digging I think it is because a variabele is sometimes an array, but sometimes just text.

The variables are $menu_names in the function menu_tree_build(), and $title in function menu_block_set_title().

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yerlix’s picture

I've tried to solve it myself.

After stumbling on the same issue but for version 2.3 (https://www.drupal.org/node/1978528), I've tried to use that patch. Without success.
Then I've tried to use that code for version 2.4 which did the trick.

This will be my first patch so just tell me if I'm doing something wrong or not by the standards.

Dave Reid’s picture

Status: Active » Postponed (maintainer needs more info)

Having $config['menu_names'] as an array sounds like very broken behavior, and is not actually supported by Menu Block. I would be interested to know how this happened in the first place.

Dave Reid’s picture

Status: Postponed (maintainer needs more info) » Needs review

Ah, I see. Sounds like a menu was deleted, but a menu block still was being output. Hmm.

Dave Reid’s picture

Issue tags: -Notice: Undefined index
FileSize
1.43 KB

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.

Dave Reid’s picture