It's currently impossible to limit a node reference field with a view that contains a relationship, rather than the base table, providing the IDs. Adding an options form to references_plugin_style to optionally choose the ID field seems like a good way to make this more flexible.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sreynen’s picture

Version: 7.x-2.0-beta3 » 7.x-2.x-dev
Status: Active » Needs review
FileSize
1.69 KB

Attached patch adds an options form with a field selector. Choosing a field changes the value of $id_field_alias to the alias of that field, allowing node reference fields to be limited based on relationships in Views, not just the base table. I've only tested this on node references, but I think it should work the same on other references, as long as the selected field is the same ID type (e.g. don't select node IDs on a view used in a user reference field).