I'm not sure if this is an issue just with my site or not, but the default user_relationships_content view does not return the correct results.

The LEFT JOIN queries seem to be incorrect and I'm unable to fix them through the views UI.

The default is

LEFT JOIN user_relationships user_relationships ON node.uid = user_relationships.requester_id
LEFT JOIN users users_user_relationships ON user_relationships.requester_id = users_user_relationships.uid
LEFT JOIN user_relationships users_user_relationships__user_relationships ON users_user_relationships.uid = users_user_relationships__user_relationships.requestee_id
LEFT JOIN users users_user_relationships_1 ON users_user_relationships__user_relationships.requestee_id = users_user_relationships_1.uid
LEFT JOIN user_relationships users_user_relationships_1__user_relationships ON users_user_relationships_1.uid = users_user_relationships_1__user_relationships.requestee_id

and it should be

LEFT JOIN user_relationships user_relationships ON node.uid = user_relationships.requestee_id
LEFT JOIN users users_user_relationships ON user_relationships.requestee_id = users_user_relationships.uid
LEFT JOIN user_relationships users_user_relationships__user_relationships ON users_user_relationships.uid = users_user_relationships__user_relationships.requestee_id
LEFT JOIN users users_user_relationships_1 ON users_user_relationships__user_relationships.requestee_id = users_user_relationships_1.uid
LEFT JOIN user_relationships users_user_relationships_1__user_relationships ON users_user_relationships_1.uid = users_user_relationships_1__user_relationships.requestee_id

In two places, it should be 'requestee' rather than 'requester'.

I'm trying to get create a node list view of posts of 'friends'. It keeps returning only partial results because the query is not correct. Everything I try in the views UI gives the same query so I'm not sure if it's a UR bug or not, but after putting the 'correct' query into phpmyadmin, I'm able to return the correct results.

Comments

cerup’s picture

Status: Active » Needs review

Looks like there is a related issue here with a fix: http://drupal.org/node/455792#comment-2423988

If someone can please confirm whether this is a bug or not so that it can be committed, that would be great. :)

rafinskipg’s picture

+1000 to this. It's important to know if there's a bug on one way relationships.

ajayg’s picture

For posts of "friends" it is difficult to say this is a bug. Since for two way relationships, once it is established, does requestee or requester has any difference? Meaning if you are friend with some one, whether he/she initiated request or you initiated request you still wants to know your friends content. Please describe the behaviour for one way relationship so it is better to understand. I am finding difficult to get my head around the concept of one way friend.

cerup’s picture

Sorry, getting mixedup up in semantics. By one-way 'friend', I just mean following someone, being their fan, etc. So it's a one way relationship. I'm a fan of X or following X (they are NOT a fan or following me - like a two-way relationship). This is an issue in one-way relationships.

mrf’s picture

Status: Needs review » Closed (duplicate)
iknowbryan’s picture

cerup - you say that you can't find a way to fix this in the Views UI... got any advice on how to fix this any other way (even if we need to patch/hack something)?
I tried the idea here: http://drupal.org/node/455792#comment-2423988
But it did not work for me (and not really what I need). I nee to be able to go to a users page and see the content of those they follow. For example
-= user 5 follows users 2, 3, and 7
-= If I go to, say, /user/5/following - I would get a list of content from users 2, 3, and 7 (as that is who 5 is following)

I'm okay with ANY way to get this to happen. Please let me know!
-=b=-

iknowbryan’s picture

Any progress on this?
Any help to get this fixed for one-way relations in views?
-=b=-

galis007’s picture

i am having this same issue are there any ideas