I have 2 content types (project and issue), you can think of this as an OG style set up, the child nodes reference the parent node via a node reference field called "project" on the issue node type.

The "project" node type has a user reference field called "members".

I'm trying to build a view to create a user reference field on "issue" called "assignee", I would like to limit the users that may be referenced to the users who are in the "members" field of the project node.

So I've created a user view with a reference type and am playing with adding contextual relationships and references, but I am getting no results. I know this is a pretty complex way to use these modules, and typically I would just write a module to achieve this, but I would really like to do this without writing a new module.

Has anyone ever dealt with anything like this?

  • What field type is the members field? Entity reference? You say I'm trying to build a view to create a user reference field - Building a view will not create any new fields. Can you try and make your question clearer as I don't quite understand what your saving at present...
    – Felix Eve
    Commented Apr 28, 2014 at 14:37
  • The "references" module provides both "user reference" and "node reference" fields. The "members" field is a "user reference" field which is clearly stated. The references module allows you to use a view to define the allowed values for the field, that is the view I'm trying to get right
    – Trey
    Commented Apr 28, 2014 at 15:20

1 Answer 1

  1. Create a view with all users.
  2. Create a relationship of type reverse join to project via the members field.
  3. Create a relationship of type reverse join to issue via the project field.
  4. Add a contextual filter on nid using the second join we created (issue).
  5. Set the view type to "references".
  6. Done :)
  • Perfect, I added the "distinct" setting to the query options to limit the duplicate results, but this is what I was looking for thank you!
    – Trey
    Commented Apr 28, 2014 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.