Hi Guys,

Did a "clean install" by installing new directory and a blank database. Started creating my own "Space" by adding sections and this warning came across:

Warning: Illegal string offset 'field_name' in oa_wiki_field_access() (line 157 of /profiles/openatrium/modules/apps/oa_wiki/oa_wiki.module).
Warning: Illegal string offset 'field_name' in og_ui_field_access() (line 823 of /profiles/openatrium/modules/contrib/og/og_ui/og_ui.module)

I did try clearing cache - the warnings were still there.

Not a blocker for sure.

Adam

Comments

jkingsnorth’s picture

Category: Feature request » Bug report
Priority: Normal » Minor

Confirmed.

jkingsnorth’s picture

Priority: Minor » Normal

This is because the field 'og_group_ref' is coming back as a string rather than an array in $field.

I don't think the right fix is to just check !empty(), surely this $field should be returning an array and not just a string? That's why the OG UI module is also throwing a warning.

You can see this by adding dsm($field); or similar into the oa_wiki_field_access hook, ~ln 157 of oa_wiki.module

mpotter’s picture

OK, tracked this down.

Looks like in the autocomplete ajax callbacks added for the new Select2Widget fields, it's doing:

  $items['oacoreselect2widget/ajax/%/%/%/%'] = array(
    'title' => 'Ajax callback',
    'page callback' => 'oa_core_select2widget_ajax_callback',
    'page arguments' => array(FALSE, 2, 3, 4, 5),
    'access callback' => 'field_access',
    'access arguments' => array('edit', 2, 3),
    'type' => MENU_CALLBACK,
  );

which is causing field_access to be called with the name of a field instead of a full field array. We will need to write our own access function to handle this. Will work on this and get a fix for 2.30-rc2. Thanks for the report!

hefox’s picture

Should first be fixed in select2widget, then we can use that function

(I copy and pasted the menu defination from there)

hefox’s picture

Status: Active » Fixed
adam fermier’s picture

Yahoo - thanks guys!

katrien_w’s picture

I applied the patch but am still seeing this error.
Should I update the media module within OA or wait for the new rc2?

hefox’s picture

Wait for rc2, it needed to be fixed in both select2widget and oa_core

Status: Fixed » Closed (fixed)

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