See comment #8 where the steps are described and comment #11 that confirms the change!

-------------

I'm using drupal 7.23.Recently updated og to latest recommended version.After that i Rebuild the content access permissions got this error

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /pinaque/batch?render=overlay&id=145&op=do StatusText: Service unavailable (with message) ResponseText: OgException: Cannot set visibility of node ID 12 as the group of type "open_group" does not have the "Group visibility" field attached to it. in _og_access_verify_access_field_existence() (line 250 of D:\xampp\htdocs\p\sites\all\modules\og\og_access\og_access.module).

After that I tried to create the article (having the group audience field) but it gives the same error

OgException: Cannot set visibility of node ID 54 as the group of type "open_group" does not have the "Group visibility" field attached to it. in _og_access_verify_access_field_existence() (line 250 of D:\xampp\htdocs\p\sites\all\modules\og\og_access\og_access.module).

Every content which has the group audience field gives the same error.

I have two group types One is Open group & another is Close group.Since i don't want that open group have the group visibility option so I didn't add group visibility field in it.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cord1’s picture

Below problem solved in commons 7.x-3.3-rc4
******************************************
trying to add a post to the group I get following excetpion:
OgException: Cannot set visibility of node ID 13 as the group node of type "user" does not have the "Group visibility" field attached to it. in _og_access_verify_access_field_existence() (line 250 of /srv/www/htdocs/commons7x33rc2/profiles/commons/modules/contrib/og/og_access/og_access.module).

The same happens with a Public group with "Any site member can contribute"

saurabh tiwari’s picture

I'm not using drupal commons.

I'm using drupal 7.23

AT last i have to add the group visibility field to open group to solve the problem.Set it to default & hide the field.

Sigvard’s picture

I have exactly the same problem.

How did you solve it?

I triggers when rebuilding permissions and when I try to create a node with "use group defaults" as visibility.

saurabh tiwari’s picture

I think you need to add the "Group visibility field" to your groups.

Sigvard’s picture

Now I've solved my problem. Apparently I had accidently selected "Posts" to be groups and group content despite being supposed to only be content posted to a group.

The error message I got was:
OgException: Cannot set visibility of node ID 326 as the group node of type "post" does not have the "Group visibility" field attached to it. in _og_access_verify_access_field_existence() (line 250 of /var/www/***/sites/all/modules/og/og_access/og_access.module).

Apparently this became an issue because the
_og_access_verify_access_field_existence($node) {

Didn't exist in older versions of OG Access and now it seem to test all content types each time you post any node.

I am not sure on if this is intended but that is how it works.

joachim’s picture

For this error:

OgException: Cannot set visibility of node ID 54 as the group of type "open_group" does not have the "Group visibility" field attached to it. in _og_access_verify_access_field_existence() (line 250 of D:\xampp\htdocs\p\sites\all\modules\og\og_access\og_access.module).

See #2063385: _og_access_verify_access_field_existence() assumes node group type, throws an exception rebuilding node access.

royerd’s picture

Can you explain how to add group visibility field to the group? My group members have lost their ability to see each others' user profiles or any access to their fellow group members.

RogerB’s picture

Try this.

  1. Go to Administration » Configuration » Organic groups » OG field settings,
  2. In the Bundle dropdown select your group,
  3. In the Fields dropdown select 'Group visibility',
  4. Click Add field

That fixed it for me.

royerd’s picture

Thank you.

sassafrass’s picture

I encountered the same error after upgrading and trying to rebuild permissions. The og-access, field visibility issue created access problems in the first place which is why I tried to rebuild them.

I tried to add the visibility field to my groups via #8; however, I got an error saying that the visibility field could only by added to Node Entities, which my group is. It is noteworthy to add that I updated the OG module and the Entity module at the same time, because they both had security updates.

My final solution was to revert back to the previous version of OG and rebuild the permissions. Things are now working as expected, but it doesn't fix/explain the issue in the upgrade other than that the problem lies with the visibility field in the og access module.

amitaibu’s picture

Status: Active » Fixed

#8seems to be the right answer - OG now forces you to have a visibility field on the group itself (i.e. not only on the group-content).

Status: Fixed » Closed (fixed)

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

Dimitrius’s picture

Issue summary: View changes
Status: Closed (fixed) » Needs review
FileSize
1.51 KB

After updating to og 7.x-2.3 I have the same error when trying to rebuild permissions or update group content which have a relation with different group types - node and user groups for my case:
"OgException: Cannot set visibility of node ID 812 as the group node of type "user" does not have the "Group visibility" field attached to it. in _og_access_verify_access_field_existence() (line 250 of sites/all/modules/og/og_access/og_access.module)."
So as an OG field access ('Group visibility') can be added only to the node group then I guess need to verify in the _og_access_verify_access_field_existence() function only the node groups

Dimitrius’s picture

FileSize
1.62 KB

Re-roll for 7.x-2.4

Status: Needs review » Needs work

The last submitted patch, 14: 2063479-error-on-rebuilding-permissions-14.patch, failed testing.

Dimitrius’s picture

Version: 7.x-2.3 » 7.x-2.4

Change the version

Dimitrius’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 14: 2063479-error-on-rebuilding-permissions-14.patch, failed testing.

rbrownell’s picture

#8 Also worked for me... Years later.

izmeez’s picture

Title: Error thrown on rebuilding permissions after updating to og 7.x-2.3 » OG requires a visibility field on the group itself (i.e. not only on the group-content).
Version: 7.x-2.4 » 7.x-2.x-dev
Category: Bug report » Support request
Issue summary: View changes
Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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