Approval requests are always from Anonymous
facelikebambi - June 6, 2009 - 08:38
| Project: | User Relationships |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hi
My users can see incoming pending relationship requests no problem. But when they click on Approve, the popup says:
"Are you sure you want to approve the relationship request from Anonymous?" instead of the correct username. (see screenshot attached)
If they click Yes, the relationship doesn't get created. I have tested with full permissions just to see if it made any difference (see screenshot)
Thanks
| Attachment | Size |
|---|---|
| user_relationships_screen1.png | 6.41 KB |
| ur_permissions.png | 4.66 KB |

#1
Please try in Garland to eliminate any custom theming from the equation. Also run through update.php just in case. Are you using any user-related modules that might override username rendering? Have you tried to open this link in a new tab, so that you get the form on its own page, rather than the AJAX popup?
#2
Thanks for your suggestions. I just tried switching to Garland, ran update.php and opened the link in a new tab... but still getting the problem.
I also tested using a clean Drupal installation and didn't get the problem - the approval option worked just fine. So maybe another module is to blame, but I don't think I have any that would override username rendering.
On my live site, I noticed that the Approve link URL always has 0 for the UID. For example:
localhost/mysite/user/127/relationships/requested/0/approve?destination=relationships%2Frequests
Very strange... if I click the username link next to 'Contact from xxx' then it links to the requesting user profile no problem.
#3
Strange, but it happens sometimes that modules step onto each other's toes. Try disabling modules one by one and see which one is causing it... that's probably the quickest way to narrow it down.
#4
Ah I think I have found the cause, and it isn't a conflicting module.
When I look at the user_relationships table, there are duplicate records with the same rid reference. Is this legitimate?
I think these duplicates were created using the buddylist migrate module in 5.x. After doing the migrate, I upgraded straight to 6.x
When I look at new records added to the table since then (ie. by users trying to create relationships), the rid value is 0
So by dropping the table and starting again, the problem is fixed (new relationships get a valid rid value). But I'd really like to keep existing (imported) relationships if possible...
Thanks
#5
I copied the out-of-date user_relationships table to a clean table, allowing auto_increment on the RID field. Now works :)
#6
Thanks for following up. It sounds like auto-increment was not turned on when migration took place. Can you describe the sequence of steps you took for migration? Perhaps this is just unaccounted for. Thanks.
#7
Sure - I was running an older 5.x site with the Buddylist module.
I wanted to upgrade the site to 6.x and go with User Relationships instead, so I installed the latest 5.x release of User Relationships to take advantage of the migrate module. This imported the Buddylist contacts into User Relationships no problem.
(I suspect that in doing this, the migrate module created duplicate records for 'mutual buddy' relationships. It gave both relationships the same RID reference, which may have caused problems later...)
When I upgraded my site and modules to 6.x and ran update.php, I think a database error was reported on user_relationships table (for the reason mentioned above?). To be honest, various modules were giving me errors so I probably didn't take as much notice as I should have done. So the table wasn't updated properly and the auto increment on RID wasn't added.
So when users tried to add relationships, no RID number was generated for the new row in the table.
Hope this helps!
#8
I think upgrading modules from 5.x to 6.x assumes that they have the same database schema, and UR recently added the auto_increment feature, but only in 6.x. So that's where things got unglued.
The same rid for two-way relationships is correct, that's how it is meant to work. The reason is to be able to query for all of user's relationships in one go. The unique key defining a relationship, hence, is rtid + requester + requestee.
Thanks for following up, at least the issue is known now.
#9
Automatically closed -- issue fixed for 2 weeks with no activity.
#10
I have this same problem, but I haven't done any importing of Buddylist.
I did make a dump of database from my live site to dev-site, and I was trying to update facebook_status and activity module. But now suddenly I get "Anonymous and Anonymous are not friends anymore" in activity. And for some reason activity doesn't list creation of relationships at all (checkbox is chosen in the settings).
#11
Sounds like an Activity problem... if you have not touched the user_relationships table, and it has no stray data or an incorrect "Next Autoindex " of the auto_increment 'rid' column, then it's something external to UR.