After a bit of head-scratching and doodling I've come up with a working version of a View that features multiple reverse references, all tied to an argument that checks a value against the currently logged-in viewer. It's a little complicated! But I think I've run into a bug...maybe. I'll lay out my use case as simply as possible.
I have a node type "office." This is comprised of a name of a facility, with a node reference to another node type "hospital" (hospitals this office deals with) and user reference to "technician" (employees who are associated with this office). The "technician" user reference is not limited in the number that can be referenced, nor is the node reference limited to the number of hospitals that can be referenced.
The "hospital" node type is nothing more than a name and an address.
The "technician" user type is just a user.
My goal is to generate a View of all hospitals handled by all offices with which the logged-in user (a technician) is associated. Currently my query looks like this:
SELECT node.nid AS nid,
node.title AS node_title
FROM node node
LEFT JOIN (
content_field_hospital node_data_field_hospital
INNER JOIN node node_node_data_field_hospital ON node_data_field_hospital.vid = node_node_data_field_hospital.vid
) ON node.nid = node_data_field_hospital.field_hospital_nid
LEFT JOIN (
content_field_office node_node_data_field_hospital_node_data_field_office
INNER JOIN node node_node_data_field_office ON node_node_data_field_hospital_node_data_field_office.vid = node_node_data_field_office.vid
) ON node_node_data_field_hospital.nid = node_node_data_field_hospital_node_data_field_office.field_office_nid
LEFT JOIN content_field_tech node_node_data_field_office_node_data_field_tech ON node_node_data_field_office.vid = node_node_data_field_office_node_data_field_tech.vid
LEFT JOIN users users_node_data_field_tech ON node_node_data_field_office_node_data_field_tech.field_tech_uid = users_node_data_field_tech.uid
WHERE node.type in ('hospital')
ORDER BY node_title ASC
When I test this with a defined user who has a user reference from only one "office" node, this correctly generates the list of all "hospitals" for which this "office" has node references.
When I test this with a defined user who has user references from multiple "office" nodes, I get nothing.
The way I've built this View is as follows:
1) Start with one field (Node: Title and one filter (Node Type: hospital)
2) Add a Content Reverse Reference relationship: "hospital reverse reference"
3) Add a Content Reverse Reference relationship: "office reverse reference," with a relationship to "hospital reverse reference"
4) Add a Content relationship: "Tech", with a relationship to "office reverse reference"
5) Add an Argument: User(UID), with a relationship with "Tech"
I realize this is just ridiculously involved but I have yet to come up with a better answer. Now I'd just like some help figuring out why my techs with multiple user references pointed at them from multiple offices aren't generating the full list of all the hospitals for each office.
Thanks for your patience. Apologies if it's tl/dr.