As reported over a year ago (https://www.drupal.org/node/2146481), Flag produces an error within the admin menu:
Warning: strtr() expects parameter 1 to be string, array given in admin_menu_tree() (line 27 of /var/www/mysite/sites/all/modules/contrib/admin_menu/admin_menu.inc).
With the latest version of admin menu, it is no longer necessary to add mapping for the individual fields so the whole if (module_exists('field_ui')) statement can now be removed from function flag_admin_menu_map() within the flag.module file.
Dave Reid has produced a change record that exemplifies how the changes were implemented in Fieldable Panel Panes (FPP) module (https://www.drupal.org/node/2397007). For reference, the error in FPP was also reported in https://www.drupal.org/node/2146479. In his example, an alter can implemented if we want to support older versions of admin menu as well.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 2397047.8.flag_.admin-menu-rc5.patch | 1.37 KB | joachim |
| #3 | 2397047.flag_.admin-menu-rc5-wip.patch | 1.37 KB | joachim |
Comments
Comment #1
cmonnow commentedComment #2
joachim commentedWell, that issue you refer to wasn't reported against Flag module, and module maintainers can't be expected to keep up to date with changes in development versions of all the modules they interact with!
But yes, I'm aware of this and working on this at this very moment :)
Comment #3
joachim commentedArgh, Admin Menu doesn't like Flag being at the secondary tab level :(
Here's how far I got.
Comment #4
mcfilms commentedAny status update on this? Did it get rolled into the 7.x-3.x-dev version of December 22, 2014?
Comment #5
ed523 commentedSo this patch doesn't fix it?
Comment #6
joachim commentedCould you both please read up on the meaning of the issue status field, so you don't need to ask these questions? There is a link to documentation right here below the form element.
Comment #7
mcfilms commenteded523, I have reopened the issue on the admin menu issue cue: https://www.drupal.org/node/2371389. Maybe there will be some help there.
Comment #8
joachim commentedI've had another look at the work I had in progress, and it seems to do the trick. Not sure why I was having so much trouble with this when I last looked it.
Could someone try this out please?
Comment #9
danchadwick commented#8 Works great.
I updated to admin_menu 7.x-3.0-rc5. The described PHP warning reappeared.
I updated to today's 7.x-3.x-dev. The described PHP warning continued.
I applied #8 and flushed the cache. The PHP warning disappeared. The Struture/Flags menu contains the expect sub-menus, and these menus work.
I reversed the patch and the warnings re-appeared.
Thank you joachim for your work on this issue and Flag in general. It is appreciated.
Comment #10
jgullstr commentedI confirm #8 works. Tested on a fresh Standard install. Notices are gone, menus expand correctly.
Comment #11
cmonnow commentedJust a note that this patch assumes you have updated to at least Admin Menu 7.x-3.0-rc5 (the latest recommended release). The fallback alter can be added though it will bloat the code. Should this requirement be noted somewhere?
Comment #12
danchadwick commentedI suggest just putting that in the release notes for Flag 7.x-3.6, when it is released. Which I hope is soon. :)
Comment #14
joachim commentedHmph. D.org just ate my reply, which was long and I can't be bothered to type it all over again :(
Briefly:
- new release just rolled!
- thanks everyone who tested the patch so promptly!
- I don't think requiring people to update Admin Menu is a big deal, as the latest release fixes a critical bug anyway, and it's not like Admin Menu engenders other dependencies.
Comment #16
ed523 commentedThanks