Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Illegal choice [nid] in Your groups element with entityreference_prepopulate #206

Open
miromarchi opened this issue Oct 23, 2016 · 1 comment
Labels

Comments

@miromarchi
Copy link

miromarchi commented Oct 23, 2016

Hi. I am using github issue queue as stated in the project page on drupal.org

tl;dr Entityreference_prepopulate is not filling in the "other groups" widget for "og admin users", but adding the prepopulated nid to the "your groups" widget, causing an error.

details
I have a website with:

  • 2 user types, member and curator;
  • 2 node types: group and group content.

Members can only create group content for their groups, while curators can do everything within every group.

The problem:

If a member creates a new node in his/her group, everything is fine. The prepopulate module fills the "og reference" field with the node being viewed as his/her group (the "add node" button is only visible if the user is member of the group being viewed).

If a curator wants to create a node in another group, prepopulate module fills the "og reference" field with the node being viewed, but this group name appears in the "default widget" not in the "administrator widget". This is already strange because it appears under "Your groups" list, while it should be under "Other groups" list, IMO.

But the real problem is that node creation will work only if the curator only fills in the title and/or other simple fields and saves. If the curator fills in other fields that make a server call, like address field, or uploads a file, or fills an autocomplete entity reference field, the creation fails with message An illegal choice has been detected. Please contact the site administrator. Watchdog shows Illegal choice [nid] in Your groups element, where [nid] is that of the currently being viewed group.

If the curator creates the node with only the title and simple text fields, then he/she can edit the node later on and fill every other field no problem.

If the curator creates the node without using entityreference_prepopulate, he/she can specify any other group in the "Other groups" list, and it can also fill in every complex field, no problem.

Curator role has the "Administer Organic groups permissions" perm.

I am on drupal 7.44, panopoly 7.x-1.37, og 7.x-2.9

Thank you for attention.

@miromarchi
Copy link
Author

I have updated a bit the issue because the problem actually persist only with fields which make a server call before saving the node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants