I'm trying to set up user relationship module, so I created user relationship type "friend" this is two-way relationship.

For testing reasons I don't have "Requires Approval" checked and now when I added 8 friends they are all listed on /relationships page, but when I added 9,10,11th this list still shows only 8 friends. It will eventually show more than 8 users, but still some of them are missing.

Comments

alex.k’s picture

Assigned: Unassigned » alex.k
Status: Active » Fixed

Committed a fix for this in http://drupal.org/cvs?commit=230894. The problem was in the way the query in _user_relationships_generate_query() was generated. It returned both directions of two-way relationships in some cases, especially when using 'between' or 'user' parameters without sorting by rid (which naturally removed duplicates and masked the error).

So the default behavior of user_relationships_load has changed to not return these duplicates by default, which I think makes sense. This automatically fixes the problem described above, as well as in UR Blocks #481216: Wrong amount of users displaying in User Relationships: friends block. In case the old behavior is needed (not a typical usage I think), one can add 'include_twoway_reverse' => TRUE in the $options argument to user_relationships_load.

Please test this for any other side-effects - I added some simpletests to check it doesn't affect other usages, but having someone check on real data would be helpful.

alex.k’s picture

Second part of the fix committed, http://drupal.org/cvs?commit=230908.

alex.k’s picture

Additional test cases and corresponding fixes in http://drupal.org/cvs?commit=230982. Hope that's it.

alex.k’s picture

Status: Fixed » Active

Per reports in http://drupal.org/node/465752#comment-1792438 reopening this issue

alex.k’s picture

Status: Active » Fixed

Committed a fix for the above in http://drupal.org/cvs?commit=235636 with additional test cases.

ayalon’s picture

Thanks for committing that fix.

I searched several hours because all my "Received requests" didn't show up in my pending block. I found out, that the problem is in _user_relationships_generate_query() but I did not manage to find a solution.

Thanks a lot!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

ih2502mk’s picture

Can somebody create a patch or provide a code snippet of solution to this issue. Since drupal is on git and the link http://drupal.org/cvs?commit=235636 does not work.

Thank you in advance.

mrf’s picture

commit a081ab7335c6364c0e982388f370189de36038b7, and commit db1cd4ec30955df74e91630fa40e6887b19dbc2c I am pretty sure are the two referenced commits in this issue, looking at in reference to #913510: Unable to remove friends