Affecting rules on a node containing a field collection?

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by wipeout_dude on May 9, 2012 at 12:38pm

Hi,

I am trying to create a rule that will modify the permissions (ACL) of the node containing the field collection based on a user reference field in the field collection entity..

By the looks of it I have to use "field-collection-item:host-entity:" but in the data selector is doesn't have any further options to pick up the node id or anything for the host entity..

I am sure I am probably missing something simple but can't see it..

The rule I am trying to create is simply if a field collection item is created where the field collection contains the user reference field set view permission to the node containing that field collection entity..

Anyone got any suggestions?

Thanks.

Comments

Can you describe your rules

Posted by dimsum on July 7, 2012 at 6:38am

Can you describe your rules settings or what you want it to be? Such as:

Events:

Conditions:

Actions:

I've been struggling with Rules and Field Collection these past few weeks. Only to realize just now that Field Collection is an entity which attached to another Node. So if you need to do something with the Field Collection values you need to select the entity (Field Collection), not the node.

I hope i'm being clear enough :)

Yes, thanks I did work that

Posted by wipeout_dude on July 7, 2012 at 9:18am

Yes, thanks I did work that out eventually.. Sorry, I should have come back and posted that..

Also for anyone else that comes across this thread.. A field collection can be addressed as a "list" as well so a loop can be created to process through all the items in the field collection and do whatever it is you need it to..

Hey wipeout_dude, did you

Posted by dimsum on July 7, 2012 at 4:40pm

Hey wipeout_dude, did you figure out how to do that as a Conditions? I've been trying to figure this out for a couple of hours.

@dimsum - What do you mean as

Posted by wipeout_dude on July 8, 2012 at 9:51am

@dimsum - What do you mean as conditions?

If you mean that you woant to go through the field collection as a list but only react on some of them based on a condition then the only way I can think of to do that would be to create a component that had the conditions and call the component from the loop.. Hope that makes sense..

Rules

Group organizers

Group categories

Categories

Group notifications

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

AltStyle によって変換されたページ (->オリジナル) /