Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi Amitai,
The following OG exception
OgException: There are no OG fields in entity <em class="placeholder">user</em> and bundle <em class="placeholder">user</em> referencing <em class="placeholder">node</em> - <em class="placeholder">club</em>. in og_group() (line 2005 di ../og/og.module).
is triggered when a user try to create a SECOND GROUP in a configuration where only and only one group per user can be created/joined (configuration obtained setting cardinality = 1 for group_group and og_user_group_ref fields)
No exception are triggered if user is creating is FIRST GROUP.
Also I think that the link node/add/group should not appear at all if a user has already created his first (and unique) group.
Thank you for working on this
MXT
Comments
Comment #1
MXTComment #2
held69 CreditAttribution: held69 commentedReceived this error after creating an og node as user #1
The field admin/config/people/accounts/fields/field_group_membership
are set to unlimited as well as on
admin/structure/types/manage/group/fields/group_group
The error dissapeared after removing the group membership field (mentioned above) and adding it back on.
however then seeing:
Notice: Undefined index: entity keys in entity_extract_ids() (line 7715 of C:\wamp\www\mysite\includes\common.inc).
https://drupal.org/node/2180165
Comment #3
NancyDruI too am seeing this error now.
OgException: There are no OG fields in entity <em class="placeholder">node</em> and bundle <em class="placeholder">portal</em> referencing <em class="placeholder">node</em> - <em class="placeholder">resource_team</em>. in og_group() (line 2017 of /modules/contrib/og/og.module).
This started when we added a second group type and went back and restricted this node to only the original group type.
Comment #4
NancyDruI can set the field to unlimited and it works. But if I set it to 1, it does not. This is even after deleting the field (og_group_ref) and re-adding it.
Comment #5
jukka792 CreditAttribution: jukka792 as a volunteer commentedI am also seeing this "OgException: There are no OG fields in entity..." with OG 7.x-2.7.
But running cron between the deletion and creation of a new group helps. Or increasing the value "group membership" on this page: admin/config/people/accounts/fields/og_user_node
Also I have this setting selected in the "OG settings"
"Use the core's queue process to operations such as deleting memberships when groups are deleted."
Case 1:
When the value in the "group memebership" is "1" on this page: admin/config/people/accounts/fields/og_user_node
1. Create group
2. Delete group
3. Create new group
4. = OgException: There are no OG fields in entity...
(run cron)
1. Create group
2. Delete group
2.1 Run Cron
3. Create new group
4. NO ERRORS
Case 2:
When the value in the "group memebership" is "2" on this page: admin/config/people/accounts/fields/og_user_node
1. Create group
2. Delete group
3. Create new group
4. NO ERRORS
(but repeting the above steps comes again "OgException: There are no OG fields in entity..." )
So how to limit members to belong only to 1 group at a time but group administrators create and delete groups.
I am not sure, but maybe this setting has something to do with the error: "Use the core's queue process to operations such as deleting memberships when groups are deleted."
Comment #6
NancyDruI am not using that setting. I am also not deleting groups. But I did fail to mention that the content I am trying to create is itself a group which also belongs to another group.
Comment #7
gunwald CreditAttribution: gunwald commentedI have the same problem. Actually I am using the code
to add a node to a group programmaticall. This node type definitely has the groupref field .
Comment #8
darrenwh CreditAttribution: darrenwh as a volunteer and at Investis Digital commentedAdding related ticket
Comment #9
darrenwh CreditAttribution: darrenwh as a volunteer and at Investis Digital commentedComment #10
joelpittetFixing title