| Project: | User Relationships |
| Version: | 5.x-2.8 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | alex.k |
| Status: | closed (fixed) |
Issue Summary
Imagine that you have 2 relationship types, e.g. 'friend' and 'blocked', on your website. A blocked user might be a user you want to block from messaging you or submitting content to your guestbook.
In order to make it comfortable for the user to setup a relationship with another user, you want to provide a direct link on the profile page of the other user: add to friends & block this user.
Now the problem is that with the main relationship module, you don't have a separate url for each relation. There is only one, which is returning the select form. It's a bit cumbersome that a user has to select (again) what relation he want to make with the other user.
Possible: find attached a plugin module for user_relationschips which offers direct urls for each relation. By enabling it, the user wont get the select form anymore, but directly a confirmation dialog to set the relation.
It would be nice if this plugin could be part of the official release.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| user_relationships_direct.zip | 1.46 KB | Ignored: Check issue status. | None | None |
Comments
#1
I fixed a small bug in the code, so here is an updated version.
#2
I should have checked it before posting it. Previous attached modules wont work. This one should work.
#3
I like what I see in this so far. I'm going to take a deeper look at it before accepting to in to the project.
#4
Adding reference to other issue which could make use of this plugin: http://drupal.org/node/274785
#5
#6
toemaz, just tried this module out on a fresh 5.10 install with UR 5.x-2.8
From what I see it doesn't add direct links to request each type of relationship to the Relationship Actions area of a user profile. I'm assuming you had a custom theme drawing these links? If so, would you be able to replace the default 'Create a relationship with %user' link with a list of links to each available relationship type? That would make the module work out of the box. Looks like the hook theme_user_relationships_request_relationship_link() might work for this.
Also, I'd not do drupal_not_found if a rtid is not given, i.e. when using an old-style link. Just let the form be displayed as is, no harm there.
Let me know if you are able to make these changes. For D6 I want to add this feature into the API as it's pretty valuable in most cases I'd think.
Thanks!
#7
Heya, I'm about to download this patch an apply it because this is functionality I really need on my site - I only have one user relationship type and I just want to have people add it directly without having to choose it from the select box again. Is this patch alright for a production site as is?
#8
@ Alex.k, Elly,
I'm currently still running buddylist1 and my urge to upgrade to UR has fade away a little. Therefore, I don't have time directly to look into this plugin again. I developed it up to the point I would release it on my own production site, but for sure, issues might still pop up. It's also likely that the UR module (API) has improved and that this plugin doesn't work out of the box anymore.
So, feel free to take this issue, test & enhance the plugin or even port the functionality inside the UR module.
#9
elly, the patch works well with the caveats i mentioned - your theme needs to hide the old 'create a relationship with user' link and render its own direct links where needed. Otherwise it works well.
#10
Alex, you're right about that. I should have mentioned that in a README file.
#11
@toemaz, @elly,
I'm working on incorporating the module into the 5.x-2.x branch.
#12
Committed the module to the 5.x-2.x branch. I've also corrected outstanding issues: the module will show links to each relationships type in the 'relationship actions' area of user profiles. It is also backward compatible, and will also accept links without a rtid.
#13
#14
Awesome, thanks! I installed the patch after I posted before and it works great. I am a theming monster so the need to override the default link wasn't a big deal, I had a whole custom user page anyway. Thanks for the module and the patch!
temp
Automatically closed -- issue fixed for two weeks with no activity.
#15
Automatically closed -- issue fixed for two weeks with no activity.