Understanding the Data selector

Events happening in the community are now at Drupal community events on www.drupal.org.
nonprofit's picture

I would like to add a comment to the OG node each time a user becomes a member of the group using Rules 7.x-2.0. (Odd use case, I know, but believe it or not it really does make sense in the context of the site.)

My Process:
React on Event: "User has become a group member"
The Action will be "Create a new entity," "comment" but my data selector is lacking fields so I need to use the condition 'entity has field' (or 'content is of type').

It seems we'll need to load the GID.

Add condition:
"Entity is Group" with the Data selector "site:current-group."

Add Action to create comment:
Data selectors for node are not displaying any fields (all are arrays ending in a colon; site:current-user:roles:, site:current-user:og-membership:, etc.)

My Question:
As similar behavior when condition is set Entity is of type: Parameter: Entity: [og-membership], Entity type: OG group, how do I access the field values? Does anyone have an idea of what I'm doing wrong?

Thanks!

Hans

Comments

looking for something similar

Energyblazar's picture

I too wish to do the something very similar for which i need to access reference field and fivestar field created in comment form.....have u found any solution yet ? ....here is link to my post... http://groups.drupal.org/node/216434

Entity is of type: og-membership:group

othermachines's picture

It's an old question, but if the answer were here it would have saved me some time.

I believe what is needed is:

Condition:
Entity is of type: og-membership:group
Entity type: Node

This should give access to the fields in your actions.

Rules

Group organizers

Group categories

Categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: