the one way relationship does not work. both users are able to see the relationship instead of 1. I enabled approve relationship option when i tested it.
the one way relationship does not work. both users are able to see the relationship instead of 1. I enabled approve relationship option when i tested it.
Comments
Comment #1
rush86999 commentedi am getting a site developed and the one way relationships are not being respected as one way for some reason. I have the latest user relationships installed. Is this bug cleared? or Is it awaiting being fixed? I am raising this to critical because implications also get messed up due to one way relationships not working properly. I am trying to set up a "buyer-seller" relationship between two users. If user A is buyer, then User B should seller, but with implications, both users become buyers and selllers of each other. Is this a PHP version problem? Any suggestions on this being fixed? Or was it never intended to be used in such a way?
Comment #2
rush86999 commentedI received your email about default relationship views. I will check it out although I am not having views installed on my site for website performance. Is that an issue?
Comment #3
rush86999 commentedforgot to mention thanks for the response for checking out the dev version
Comment #4
rush86999 commentedforgot to mention thanks for the response for checking out the dev version
Comment #5
rush86999 commentedone way relationship still does not work for me; I have no idea wuts going on
Comment #6
craigmc commentedIt seems to me that in implementation, one-way relationship is reversed.
Meaning that if I check "one way relationship", then if I do a query for all relationships for the given user--user_relationships_load(array('user' => $uid')) then I actually get all of the relationships that user is a part of.
This is the relevant portion of the query generated....
(ur.requester_id = 196903 OR ((urt.is_oneway = 1 OR ur.approved = 0) AND ur.requestee_id = 196903)
As written, if the relationship is "one way", then the user can be at either end of it, otherwise, it only gives them the relationships the user has requested. If anything, that seems one-way to me.
So I think the terminology is a bit of a misnomer. Finally figured it out myself, to call my 'friend' relationships one-way, and suddenly they work as I expected, as reciprocal...
Comment #7
alex.k commentedYou probably want to use 'requester_id' => $uid rather than 'user' => $uid if you only want to include one direction. Marking this one fixed as the original issue is pretty old, please reopen if assistance is needed.