Project

General

Profile

Bug #4288

Add Friend -1

Added by Samantha Raddatz about 6 years ago. Updated about 6 years ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
BuddyPress (misc)
Target version:
Start date:
2015-07-10
Due date:
% Done:

0%

Estimated time:

Description

After clicking 'Add Friend' on the directory page (http://commons.gc.cuny.edu/members/), a '-1' appears where the button was before (see red circle in attached screenshot). Instead, this should say 'Request sent' (see mockup attached).

-1mockup.png (160 KB) -1mockup.png Samantha Raddatz, 2015-07-10 02:45 PM
-1screenshot.png (158 KB) -1screenshot.png Samantha Raddatz, 2015-07-10 02:45 PM

History

#1 Updated by Boone Gorges about 6 years ago

  • Status changed from New to Resolved
  • Target version set to 1.8.5

This is a really odd issue. It's caused by a weird combination of factors: a BuddyPress upgrade from a few months ago, along with the fact that we don't use BP_User_Query for our Members directory. This was causing BP to think, incorrectly, that the logged-in user was not friends with anyone in the Members directory, making it show the Add Friend button even though a friendship already existed. As such, there was a nonce mismatch when the friendship request was sent upon clicking the button.

I'm pretty sure that this points to a bug in `friends_check_friendship_status()` - it's not accounting for users of the legacy user query - but I'll let Ray decide whether (a) that's the case, and (b) it's worth fixing in BP.

For CAC, I've put a super weird workaround in place https://github.com/cuny-academic-commons/cac/commit/fa996b3c8a275651b075982530ffd676dc3d1a28 which will restore buttons to their proper behavior.

Also available in: Atom PDF