0

THE SETUP:

A custom user type - "Store Owner" - has access to create/manage 2 types of content:

  1. Store (which includes a "Related Products" field)
  2. Product

When the user first sets up their account, they are directed to set up their store. The store is then linked (using Rules) to the user->owned_store field.

All of the above is working. Here's where I'm running into a problem:

THE PROBLEM

Once a Store Owner already has a store created, they are prompted to create nodes of type "Product." I'd like to then use Rules to automatically assign the new Product to that store's "Related Products" (an entity reference field with unlimited values).

In rules, I can see "Set a data value" and, for the data selector, I can drill down to site:current-user:field-owned-store: but inside of field-store I only see the body field. I can't figure out how to reference and add to site:current-user:field-owned-store:related-products to add the node that the user just created.

NOTE:

If there's an easier way to do this not using Rules, I'm also happy to do that. But currently the only other option I can come up with is inline entity creation - but I'd rather not take users to their Owned Store > Edit page every time they want to add a new product node.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.