Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
JohnAlbinmodule_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.
Comment #2
SRampley CreditAttribution: SRampley commentedSorry 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.
Comment #3
lambic CreditAttribution: lambic commentedSame issue here, we have to disable menu_access on sites using menu_block.
Comment #4
lambic CreditAttribution: lambic commentedComment #5
JohnAlbinCan 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.
Comment #6
lambic CreditAttribution: lambic commentedYep you're right, I didn't even realise we were a version behind. Thanks!