Opened 15 years ago
Closed 14 years ago
#2306 closed defect (bug) (worksforme)
Add Friend Button on member directory wrong after having added friend
Reported by: | phlux0r | Owned by: | |
---|---|---|---|
Milestone: | 1.5 | Priority: | normal |
Severity: | Version: | ||
Component: | Core | Keywords: | add friend button |
Cc: |
Description
In BP svn rev. 2914 when I request friendship and the friend approves it, then go back to the member list, the Add Friend button is still showing "Add Friend". Clicking it returns -1/.
In bp-core-templatetags.php in function bp_member_add_friend_button there is a test:
if ( null === $members_template->member->is_friend )
the next statement is:
$friend_status = 'not_friends';
but that's not correct since the is_friend isn't set so the statement should read:
$friend_status = null;
This will force the bp_add_friend_button() function to check for the friendship and display the correct button.
HTH
I actually noticed this the other day too. I just now tried it with the latest trunk, and the problem is gone. There weren't any code changes that should have fixed this, at least from first glance, but now I can't replicate the problem.
However,
$friend_status = 'not_friends';
is correct, because if you forcebp_add_friend_button
to check for friendship, it will ultimately runBP_Friends_Friendship::check_is_friend
, which will still return 'not_friends'. So this was (possibly still is) a result of something else.Since the release of 1.3 not too far in the future, and trunk is what will eventually become 1.3, we should shoot to have this fixed for 1.3.