I have the following warnings when using FAPE, Panels IPE, and Organic Groups. (I'm integrating OG into Panopoly.)
The warnings occur when og_field_access($op, $field, ...) tries to access $field['field_name'] for $field= 'group_group'.
Warning: Illegal string offset 'field_name' in og_field_access() (line 592 of /sites/all/modules/og/og.module).
Warning: Illegal string offset 'field_name' in og_ui_field_access() (line 773 of /sites/all/modules/og/og_ui/og_ui.module).
Warning: Illegal string offset 'field_name' in og_field_access() (line 592 of /sites/all/modules/og/og.module).
Warning: Illegal string offset 'field_name' in og_ui_field_access() (line 773 of /sites/all/modules/og/og_ui/og_ui.module).
FAPE is passing $field_name instead of a full field structure array to field_access() [inside of fape_panels_pane_content_alter] which then cascades down to og_field_access().
Comments
Comment #1
ericras commentedComment #2
panchoI can confirm the bug, and the patch #1 fixes it.
I just refactored the code a bit, so it is less redundant and more readable, so either of the two should be fine. But please do some testing!
Comment #3
panchoSame bug in fape_field_edit_page(), leading to some more of the same warnings:
Enclosed patch should fix both bugs, but please do some thorough tests.
Comment #4
kclarkson commentedI am confirming that the patch applied cleanly and has fixed the error message.
Comment #5
panchoThe same patch, but a bit simplified. We don't really need the helper function I added in #2.
From what my tests say, it works fine.
Comment #6
hydra commentedThis should proabably be updated to the newest version of Pancho's patch. Still needs review, works for me.
Comment #7
mpotter commentedUsing this (#5) in Open Atrium 2 without any problem.
Comment #8
das-peter commentedPatch from #5 looks good and I can confirm that it solves the problem.
Comment #9
saltednutWe're using #5 in Demo Framework. RTBC++
Comment #10
mrfelton commentedNow using #5 in the Panopoly distribution too.
Comment #11
saltednutComment #12
saltednutI believe there may still be something going on here. I am seeing errors in the logs but not on every page. Can anyone confirm?Error appears to have been environmentally specific. Sorry about that.
Comment #13
saltednutComment #14
saltednutComment #15
drupalycious commentedI confirm that patch#5 fixed the following errors:
Illegal string offset 'field_name' in og_ui_field_access() (line 823 of /.../sites/all/modules/og/og_ui/og_ui.module).
Illegal string offset 'field_name' in og_field_access() (line 588 of /.../sites/all/modules/og/og.module).
Will it be committed?
Comment #16
nlambert commented#5 works for me
Comment #17
damienmckennaThanks for the patch, I'm committing it after making a minuscule tweak or three.
Comment #18
damienmckennaComment #20
saltednutw000t!
Comment #21
damienmckennaComment #23
cmonnow commentedJust some trivia...this bug only reared its head when I upgraded from PHP 5.3 to PHP 5.5.