Warning: Invalid argument supplied for foreach() in entityreference_field_widget_form() (line 815 of /var/www/html/profiles/commons/modules/contrib/entityreference/entityreference.module).

Comments

Anonymous’s picture

Category: bug » feature

After further research, I found the uid assigned the node was not in the group. After assigning the user to the group, the error went away.

Changing this to a feature request to create an error message similar to:

The user is not a member of the group to which this node belongs.

geresy’s picture

Why not automatically make the user a member of the group?

jpontani’s picture

Category: feature » bug

It's not really a feature request, as we want don't want to force a user to join a group if they want to create a node in a public group, or restrict them from creating nodes in public groups. As far as I'm aware, the plan is to allow all users to create nodes in public groups, regardless of membership.

I may be wrong, so I'll have to double check on this though.

ezra-g’s picture

Status: Active » Postponed (maintainer needs more info)

@gr8britton Can you post steps to reproduce?

In general:

- At least one group is required for Commons group content
- Users are automatically added as members of public groups when they create content in that group.

Anonymous’s picture

I installed the 12/12 Dev version yesterday. Now, when I make a post logged in as one of the group's users (George Foreman), I can only add the title. The body and other components are NOT available. However, I did NOT get the message. It looks like this issue is no longer a problem.

UPDATED: I found my test user was not in the proper role to be a content editor. I added him to the proper role.

What I am finding now is that if I go to the Group and use the Add Post link there, I only get the Title (no other components) and I can create the node with no body and no error message.

If I use the Admin menu to create a new post, I get the warning message and still only the Title Component.

Anonymous’s picture

Status: Postponed (maintainer needs more info) » Active
Topcheese’s picture

@gr8britton, you changed the status to active, but you did not provide any details in order to help get your problem resolved faster. Sounds like it might not be installed properly, what is the environment and the steps taken?

Anonymous’s picture

I had entered updated info in #5 but did not get a response until I change it back to active.

To answer your further questions:

  • Apache/2.2.3 (CentOS)
  • Commons (commons-7.x-3.0-beta1+0-dev)
  • PHP 5.3.3
  • MySQL 5.0.95
ezra-g’s picture

Title: Receiving a Warning When Creating Content » Invalid argument foreach in Entityreference without URL prepopulation
Status: Active » Postponed

This is a duplicate of #1845050: reference field set to "Autocomplete (Tags style)" not returning any matches. Marking postponed pending resolution of that issue in OG.

ezra-g’s picture

Priority: Normal » Major
ezra-g’s picture

Status: Postponed » Closed (duplicate)

Looks like we have a Commons issue for this already - Marking as a duplicate of #1818180: Refactor og_group_ref field definition .

krazykellie’s picture

I'm not sure if this helps anyone, but all we did to correct this error was remove the permissions under the OG and then reestablish them. It was a quick and easy fix!