Its currently not possible to set the "group_audience" value of an entity as expected with Rules.
From a logical standpoint, what we're trying to accomplish is to "Load groups" from a "group_audience" field on another entity.
Then, using that data, apply the same list to another entity, and save it.

I do understand that entities/content can be given "memberships", by "Adding content to a group". Is "group_audience" then, meant to serve as a visibility control? As a way to visualizing content/entity ownership?

What would need to be completed in order to load or pass a group reference (audience?) to another entity?

Comments

miromarchi’s picture

hi, I don't know is my comment is helpful for you, but I believe this issue is the right place where to post it.

I used rules to add/extend a second group to the og_audience field.
In this issue: How to automatically fill the group audience field, I found a comment by @Marq which gave me a hint for what I nedded.

background information:
I have a "relation" content type behaving asgroup_content. It has mainly two entity_reference fields: "subject1" and "subject2", both pointing to og_groups nodes. It's a relation between two groups.

usecase:
user1 (of group1) add a new "relation" content with fields: "subject1" = group1 and "subject2" = group2.
When user1 saves, the "relation" content belongs only to group1 (og_audience = group1), because user1 is member only of group1.
I want to add a rule that extend the audience of the content to both group1 and group2.

solution:
new rule
Event: After saving new content of type Relazione
Condition: none
Action: Add entity to group | Parameter: Entity: [node], Group: [node:field-subject2]