I originally raised this here: http://drupal.org/node/815990#comment-3047904 but had no response, so I guess I raised it in the wrong place. I hope this is the right place

I am attempting to create a view with a list of users who have completed a particular Content Type form, but the sql that is output appears to be using the wrong field to create the join.

Create a new view of type "User"
Add two fields : User:Uid and User:Name
Add a relationship to "User: Nodes authored"

The resulting sql has the following syntax:
[code]
SELECT DISTINCT(users.uid) AS uid_1,
users.uid AS uid,
users.name AS users_name
FROM users users
LEFT JOIN node node_users ON users.uid = node_users.nid
GROUP BY uid
[/code]
Should the join not be
[code]
LEFT JOIN node node_users ON users.uid = node_users.uid
[/code]
?

After a bit of experimentation, I got it working by adding
'base field' => 'uid',
to views\modules\user.views.inc on line 70.

I don't know if this is likely to cause other problems or not.

Comments

dawehner’s picture

Status: Active » Closed (duplicate)