1. Login as user 1
  2. Go directly to: node/add/

Warning: Invalid argument supplied for foreach() in og_field_widget_form() (line 69 of .../og/includes/og.field.inc).
Warning: Invalid argument supplied for foreach() in entityreference_field_widget_form() (line 815 of .../entityreference/entityreference.module).
Warning: Invalid argument supplied for foreach() in entityreference_field_widget_form() (line 815 of .../entityreference/entityreference.module).

The $items argument in og_field_widget_form() (line 26 of og.field.inc) is not an array when adding content outside of a group.

Line 69 runs a foreach() without checking if it is an array.

I added a check for the array where $entity is checked, so it returns if no group targets are found.

Files: 
CommentFileSizeAuthor
no_group_node_add.patch439 bytesmmilano
PASSED: [[SimpleTest]]: [MySQL] 780 pass(es).
[ View ]

Comments

Status:Needs review» Closed (duplicate)

Make sure to update Entityreference-prepopulate -- the bug was there.