The function call of module_invoke_all('get_menus') returns an array of menu titles instead of a string, when more then one module implements 'hook_get_menus'.

This results in an array being passed to the t() function instead of a string.

Modules I had installed when this happened was 'menu' and 'menu_access'.

Comments

JohnAlbin’s picture

Status: Active » Postponed (maintainer needs more info)

module_invoke_all('get_menus') is supposed to return an array, not a string. Or maybe you need to explain better?

Also, in the upcoming 6.x-2.4 version, the hook name has changed to prevent some problems we were experiencing with the old hook name.

SRampley’s picture

Sorry about that, busy at work at the time of posting.
The module_invoke_all('get_menus') should return an array of menu names and titles, array('name' => 'title').
Which it dose when only one module is installed that implements hook_get_menus().
When more then one module implements this hook, it returns array('name' => array('title', 'title')).
Or at least when the two modules which use the hook are 'menu' and 'menu_access'.
The modules code dosen't account for this, and ends up passing the array of titles into t() instead.

I added the following code after the module_invoke_all() call as a quick fix.

    foreach($all_menus as $key => $value) {
        if(is_array($value)) {
            $all_menus[$key] = $value[0];
        }
    }
lambic’s picture

Same issue here, we have to disable menu_access on sites using menu_block.

lambic’s picture

Status: Postponed (maintainer needs more info) » Active
JohnAlbin’s picture

Status: Active » Fixed

Can you both try the 6.x-2.4 version? That hook was replaced and shouldn't have the problem you describe anymore. Please re-open if I'm incorrect.

lambic’s picture

Yep you're right, I didn't even realise we were a version behind. Thanks!

Status: Fixed » Closed (fixed)

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