User A adds user B
When B visits user A page, they can add user A again. This showed me some errors in database.
I think the link to add should disappear from action block when the user has added me already.
I'm trying to do an action block on my own. But I can't figure how is the request stated gotten.
I'd like to do this logic:
if ($current_relationships) {
print 'We're friends. I can remove them';
}
elseif ($USER_REQUESTED_ME_A_RELATIOSHIP) {
print 'This user had added me. I gotta aprove or disaprove them';
}
elseif ($I_REQUESTED_USER_A_RELATIOSHIP) {
print 'I added this user. I gotta wait for their aprovement or cancel';
}
else {
print 'We're not friend. Maybe I can add them';
}
How can I get $USER_REQUESTED_ME_A_RELATIOSHIP and $I_REQUESTED_USER_A_RELATIOSHIP ?
p.s. I'm implementing this from user_relationships-actions_block.tpl.php
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | Requestee looking at requester's account | 31.71 KB | alex.k |
| #5 | requester (student) looking at requesee's account | 37.55 KB | alex.k |
| #4 | 1. User Relationship - Friend requests both ways.jpg | 15.26 KB | Bilmar |
| #4 | 2. User Relationships menu - request both ways.jpg | 14.35 KB | Bilmar |
| #3 | adduser.png | 11.9 KB | andrenoronha |
Comments
Comment #1
Bilmar commentedI am also encountering this same issue.
Any solution to this problem would be greatly appreciated.
Thank you.
Comment #2
alex.k commentedI see two issues here:
1. You still see a link to create relationship after one is already created
2. Some help with implementing a custom block (pls read docs of user_relationships_load for hints on this one).
Regarding #1, where is this link displayed? Please post a screenshot. This problem was not reported before.
Comment #3
andrenoronha commentedI attached a screenshot of my block.
The link "add user as friend" should disappear when the user had added me.
Another solution would be: when I click "add user as friend" and the user had added me we would become friends right away.
thanks
Comment #4
Bilmar commentedalex.k-
I attached some screenshots as well.
I'm sending the friend request from the my account page of the users.
Thanks.
Comment #5
alex.k commentedThanks for these screenshots. I can't reproduce this issue, unfortunately (see my screens). Fan is a one-way approval-required relationship. When I make a request in one direction, the other cannot do it.
Are you running unmodified rc1 or latest -dev release? Specifically, there are patches in #348025: Two way of one-way relationship which would make similar behavior.
Comment #6
Bilmar commentedThank you for looking into this issue.
I am currently using 6.x-1.0-rc1 version.
The problem I am having is for the two-way Friend relationship.
User1 goes to User2's my account page and clicks 'Become Friends with User2'
[Friend request is sent to User2]
I login with User2 and go to User1's my account page and click 'Become Friends with User1'
[Friend request is sent to User1]
Then in the pending relationships I see both Sent and Received pending requests.
I hope this clarifies my problem and you are able to replicate it.
Thank you.
Comment #7
alex.k commentedI see the problem now, thanks
Comment #8
andrenoronha commentedI'm using 6.x-1.0-rc1 version...
Comment #9
alex.k commentedCommitted a fix and test cases to cover this situation, http://drupal.org/cvs?commit=251572. Thanks for reporting!
Comment #10
andrenoronha commentedUntil now it works beautifully for me. Thanks a lot!!
just a question: what are these test files?