I want to be able to add to my panel, described here, a view of an 'advocate' that 'endorses' an item.
Each item (unique by NID) has one Advocate (a user, unique by UID) and each User can have multiple endorsements (but still one per item).
In my view I have these settings:
I've annotated them to show how I think things link together
- NID from the URL connects to the, 'Entity Reference: Endorsement'.
- The Entity Reference: Endorsement connects to the '(Content entity referenced from field_tech_endorsement) Entity Reference: Endorser'.
- The (Content entity referenced from field_tech_endorsement) Entity Reference: Endorser connects to the 'User: Name (Name) and User: Picture'
These settings all seem 'right' to me. but I'm getting no output on my panel.
I think the crux is in the Argument input, that it feeds from the NID selected on the panel (see link), and the UID of the associated (via the relationship Entity Reference: Advocate
). But I don't know if I'm doing the 'feeding' right at all.
Nothing comes up on the preview, and nothing come up on the page.
This is what I'm hoping for:
What am I doing wrong on this view? Is my set up right at all?
What I'm trying to do is reflect this set up:
Here is the SQL generated by the query.
<!-- lang-sql -->
SELECT node.nid AS nid, #The node of the item that has this endorsement (?)
users_field_data_field_endorser.name AS users_field_data_field_endorser_name, #The username of the advocate who has endorsed the item
users_field_data_field_endorser.uid AS users_field_data_field_endorser_uid, #The UID of the advocate who has endorsed the item
users_field_data_field_endorser.picture AS users_field_data_field_endorser_picture, #The picture of the advocate who has endorsed the item
users_field_data_field_endorser.mail AS users_field_data_field_endorser_mail, #No idea why this is generated
node.created AS node_created, #No idea why this is generated
'node' AS field_data_body_node_entity_type #No idea what this is
FROM
{node} node #A Table of all nodes?
LEFT JOIN {field_data_field_tech_endorsement} field_data_field_tech_endorsement ON
node.nid = field_data_field_tech_endorsement.entity_id AND
(field_data_field_tech_endorsement.entity_type = 'node' AND
field_data_field_tech_endorsement.deleted = '0')
#Left Join our endorsements, where they're not deleted, and they're NID matches their NID (well duh)
LEFT JOIN {node} node_field_data_field_tech_endorsement ON
field_data_field_tech_endorsement.field_tech_endorsement_target_id = node_field_data_field_tech_endorsement.nid
#Left join on Where the NID of the target matches the endorsement (????) That's not right
LEFT JOIN {field_data_field_endorser} node_field_data_field_tech_endorsement__field_data_field_endorser ON
node_field_data_field_tech_endorsement.nid = node_field_data_field_tech_endorsement__field_data_field_endorser.entity_id AND
(node_field_data_field_tech_endorsement__field_data_field_endorser.entity_type = 'node' AND node_field_data_field_tech_endorsement__field_data_field_endorser.deleted = '0')
#Left join on the endorser/advocate where the Endorsements NID is the same as the NID of the endorser/advocate's endorsement AND where the endorserment is endorsing the right kind of node, AND where the endorser is not deleted
LEFT JOIN {users} users_field_data_field_endorser ON
node_field_data_field_tech_endorsement__field_data_field_endorser.field_endorser_target_id = users_field_data_field_endorser.uid
#Left join on the user details that match the endorser
WHERE (( (node.nid = '13' ) )AND(( (node.status = '1') AND (node.type IN ('endorsement')) )))
ORDER BY node_created DESC
LIMIT 1 OFFSET 0
I think my understanding of what it's doing it right, but it seems like what it's doing is wrong. What do I do to fix it?