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.
I have two content type one called audit and one called non-conformance, a non conformance is raised after an audit has been complete and has a an entity reference field to that audit.
An audit contains an entity reference field called auditee which references a user, I would like to give edit access to the non conformance based on the the content of the auditee field in on the content type audit.
I've tried lots of combinations of the rules configuration but can't seem to get access to the field.
Thanks
Comments
Comment #1
Yuri CreditAttribution: Yuri commentedYou figured this out already?
Comment #2
danharper CreditAttribution: danharper commentedNo I never did, I got asked to put this specific project on hold but I will be revisiting it in the next month or so.
Comment #3
Yuri CreditAttribution: Yuri commentedOk i figured it out just now, its simple when the entity reference field allow only one value. Getting a field value from a node through an entity reference field, requires that you first add the condition 'entity has field', for the node and adding the entity reference field. Then again add a condition 'entity has field', now selecting the first node referenced in the reference field, and seleting the field of which you want the value.
In my case i wanted the field value of field_cluster_reference of the node referenced in field og_group_ref, which makes this chain:
However, I still need to figure out how to add all values of all referenced nodes as a list, I guess I need a loop for that..if anyone can give a hint, would appreciate it.
Thanks
Comment #4
danharper CreditAttribution: danharper commentedI think under actions you add loop, so for every value found do something.
Comment #5
TR CreditAttribution: TR commentedThis question was answered long ago.
Comment #6
TR CreditAttribution: TR commented