The _user_relationships_generate_query() function does not put parens around the (ur.requester_id = %d AND ur.requestee_id = %d) OR (ur.requestee_id = %d AND ur.requester_id = %d) condition it generates when passed the 'between' parameter. This means that if you pass other criteria in addition to the 'between' parameter, the generated SQL associates the OR with other elements of the WHERE clause, resulting in incorrect results.

I've attached a patch that puts parens around the condition generated by 'between'.

CommentFileSizeAuthor
ur_load_rels_between.patch902 bytesprfctns6@gmail.com

Comments

sprsquish’s picture

Status: Needs review » Closed (fixed)

@JBChristy you asked me if there were differences between head and DRUPAL-5--2. Well, this was one of them. Sorry for the confusion.