Hi,
I notice a strange problem. When you go at http://mywebsite.com/relationship, the person who ask for a relation and this relation ship is approve by the other person, do not see the "friend". The person who accept the relationship will be able to see the person who ask in is list but not the other person.
Also, when the person accept the request, the person who made the requqest originaly can make another request to the same person again. So I think the two way relationship are not two way at all !!!
Could you please check it out. If you need to check what i'm talking about, I can send you the link to my website and check it out.
Thanks.
Comment | File | Size | Author |
---|---|---|---|
#24 | fix_twoway_reverse_relationship.patch | 3.93 KB | Berdir |
#14 | two-way-relationship-fails-1211060-14.patch | 1.18 KB | areynolds |
#9 | two-way-relationship-fails-1211060-9.patch | 1.36 KB | areynolds |
#6 | two-way-relationship-fails-1211060-6.patch | 648 bytes | areynolds |
Comments
Comment #1
sw3b CreditAttribution: sw3b commentedIs anybody having the same issue, I install on a clean version of Drupal and the problem still there ?!?
Thanks
Comment #2
Sylense CreditAttribution: Sylense commentedSubscribing. I am having a similar issue. With user relationships set to be mutual the relationship only appears on the requester's side and it should appear on both ends.
Comment #3
sw3b CreditAttribution: sw3b commentedYes and I did some testing on my side, if there is no confirmation, the relationship is both way. If there is confirmation the user who confirm the relationship will see is relation but the person who ask for it will not. Also if the person who accept try to remove the relationship from is list, it goes to a blank page or error page saying the link page is not available.
@berdir Any chance you can confirm this issue on your side too or your working on this ?!? Because this make the module no very usable for the relationship with users.
Comment #4
areynolds CreditAttribution: areynolds commentedSame issue here. It seems that a DB record is created upon sending out the request, showing a relationship between the requester and the requestee. However, upon the requestee accepting the relationship, the original record is erased and only a relationship between the requestee and the requester (with roles reversed in the DB fields) exists.
Ex:
Comment #5
areynolds CreditAttribution: areynolds commentedOk, think I found the issue. In the process of approving the relationship, the approval action was overwriting the existing DB entry instead of creating a new one. The drupal_write_record() in the following code from user_relationships.module shouldn't have a $keys argument; $keys argument indicates a new record, whereas the absence of $keys indicates an update:
Seems to work when you remove the $keys argument. Patch to follow in a couple of minutes.
Comment #6
areynolds CreditAttribution: areynolds commentedComment #7
sw3b CreditAttribution: sw3b commentedIt seems to correct the problem on my side too ! Nice work...
Comment #8
BerdirHm, yeah, I see.
The problem here is, that we are updating the initial relationship row, which is correct, but we need to insert a new one for the reverse relationship.
*However*, when, for whatever reason, that relationship is edited again, it should update and contain $keys instead of creating a new row, because that would lead to duplicates.
I think we should actually just stop using drupal_write_record() and use db_merge() here.
Also, tests for this would be awesome.
Comment #9
areynolds CreditAttribution: areynolds commentedHere's a patch using db_merge(). I'd love to write some tests, but I'm still getting the hang of the testing system.
Comment #10
areynolds CreditAttribution: areynolds commentedComment #12
Berdirkey() needs to include requestee too.
Also, key fields must not show up in fields()
Comment #13
Babymaggie CreditAttribution: Babymaggie commentedJust upgraded to the latest version via drupal's own updater and I now have the same problem.
The only account registering the friendship is the person who accepts the friendship request.
Is there anyone still working on / looking at this bug?
I have completely uninstalled the module and restored the module from a backup to get the functionality working again.
Im now getting quite a list of module upgrades which have been broken :-(
Let's hope someone can fix this?
Comment #14
areynolds CreditAttribution: areynolds commentedOk, I included the requestee id and took out the key fields from fields(). Thanks for the help Berdir; it's good to get more familiar with db_merge().
Comment #16
areynolds CreditAttribution: areynolds commentedHmm, thought that would do it. Guess I'll have to learn something about the testing framework so I can understand the errors.
Comment #17
francois o CreditAttribution: francois o commentedsuscribing
Comment #18
Nicolas Bouteille CreditAttribution: Nicolas Bouteille commentedI encountered the same problem but it's great to see that you guys are already working on it!
Good luck to you and thank you!
Hope in a few months I'll have the experience to contribute on Drupal dev too. Right now I only now how to make use of modules...
++
Comment #19
ifish CreditAttribution: ifish commentedyup.. same problem here
Comment #20
choosedrupal CreditAttribution: choosedrupal commentedPatch failed. Applied to 7.x-1.x-dev
FIXED BY:
//drupal_write_record('user_relationships', $reversed_relationship, $keys);
drupal_write_record('user_relationships', $reversed_relationship);
I did run into some problems with old database structures until I uninstalled UR and reinstalled it. The uninstall worked perfectly and did not require any additional effort.
GREAT WORK on this module!
Comment #21
BruFFy CreditAttribution: BruFFy commentedchoosedrupal, check #5 and #8
duplicates problem...
Comment #22
BerdirComment #23
heyay CreditAttribution: heyay commentedIt solved the problem for me too.
Thanks a bunch ! ! bro
Comment #24
BerdirOk, here is an updated patch.
The problem with the previous one was simply that I renamed created_at and changed_at in the meantime.
I also simplified the code (there is no need for the clone stuff anymore) and added tests for this. These tests fail with the current code and would also fail with the drupal_write_record() approach.
Comment #25
BerdirTrigger testbot
Comment #26
BerdirTests pass, commited.
Comment #28
Liviu CreditAttribution: Liviu commentedIt works, good job!
Thank you.
Comment #29
Anonymous (not verified) CreditAttribution: Anonymous commentedIt works, great job
thanks a lot
Comment #30
dieppon CreditAttribution: dieppon commented@Berdir thanks dude
Comment #31
jenlamptonCan we get a new release with this fix? thx! :)