Hi,
I have struggled some hours to track this down. The problem is that id_field_alias (in entityreference/views/entityreference_plugin_display.inc) is incorrectly set when relationships are linked (back to the same base table). Example:
AUTHOR (UID) => AUTHORED NODE => LINKED USERS (UID)
where the author UID is a contextual filter (the ID of the currently logged in user). Entity reference module uses "users_uid" instead "users_field_data_somefield_uid".
I have attached a very hackish patch and my exported view.
To reproduce it:
- Create a content type Family that has one multi-valued field that links to users (which are family members/children).
- Then create one Family node and link it to two users (which are your children).
- Create a content type Test that has one field that links to users (your children) and use a view to select the entities in the entity reference list. The view is like the example above.
Result: The select list only shows one user no matter how many children you have, and when you save you have actually added your self.
Comment | File | Size | Author |
---|---|---|---|
#3 | entityreference-2321715-3.patch | 1.63 KB | hansfn |
#1 | entityreference-2321715-exported-view.txt | 5.52 KB | hansfn |
#1 | entityreference-2321715-1.patch | 1.69 KB | hansfn |
Comments
Comment #1
hansfn CreditAttribution: hansfn commentedComment #3
hansfn CreditAttribution: hansfn commentedFixing the paths in the patch and removing two blanks at the end of two comments.