Change status link for Views
Kars-T - September 25, 2009 - 13:54
| Project: | User Relationships |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
Hi,
for a project we needed a link to change the status of a relationship from a view.
There is a views integration but no column that provides a link. I did add support for this.
Now you can rebuild any page like "/relationships/list" with Views.
| Attachment | Size |
|---|---|
| user_relationships_status_link-D6-1.v1.patch | 2.55 KB |

#1
Thanks Karsten,
I tried it and found a mistake in it:
User initiating relationship gets links displayed to "approve" or "disapprove" - instead of this he should get the option to "cancel" his request.
Regards,
Ralf
#2
New version now with "Accept | Decline", "Remove" and "Cancel" links in a view field in regards to the current loggend in user.
#3
Thank you very much, will test it shortly.
One question... this check:
<?php//Do not show to guests.
?>
Is it better to check for the 'can have relationships' permission? That'll cover registered users who shouldn't be seeing the links as well.
#4
Yes checking the access right is much better. Added to the patch.
#5
This is an even more correct version. v3 used to always show the cancel link when the logged in user was the requester. Now the correct remove link is shown if the relationship was approved.
#6
Hello,
I patched the newest version of UR module and the patch was successful.
However, I'm getting 'Error: handler for user_relationships > status_link doesn't exist!' when I add the status link field.
Does anyone know what the issue may be?
Thank you!
#7
Howdy-
Is there a plan to commit this into main module?
#8
Committed in http://drupal.org/cvs?commit=285604. Thanks!!
@trupal218 use the -dev release once it includes the commit. It should work with the declaration line included.
#9
Thank you very much!
#10
I tested the newest Dev version which is resulting in the following error:
warning: Invalid argument supplied for foreach() in /home/example/public_html/drupal/sites/all/modules/user_relationships/user_relationships_api/user_relationships_api.module on line 43.
Also, I see that the remove status link in views is loading as ajax popup. Is there a way to choose not for it to be a popup but rather a page for confirming remove/cancel.
User Relationships 6.x-1.x-dev (2009-Nov-08)
#11
Hi robby.smith.
Do you think the bug is related to this patch? If yes please set this issue to needs work.
And the second thing seems to me another feature request that maybe should get its own thread? As far as I remember there are globals settings for this and as this patch uses the default API the settings should be apply here as well. So maybe this is a bug report and not a feature request.
No offense but just please keep the issue queue as clear as possible. I was puzzeld by this status change. :)
#12
ahh yes, that would be a more appropriate status. The error began with an update to the newest Dev version of User Relationships, keeping everything else the same.
Regarding the way the status link behaves, I will open a new thread with a feature request.
#13
Hello,
I have tested this several times and also on a fresh install of Drupal and do not see the issue at #10. Anyone else?
Thank you for the great work!
Also, I don't see the feature request in the queue mentioned at @#12 yet and am interested in this feature so will add into the queue now.
#14
I'm still not able to get this to work =(
I'm using Views Content Panes in a Panel and the url below shows for the status link 'remove' when users are friends in the view.
http://example.com/user/1/relationships/%2Fremove?destination=myfriendspage
I would appreciate any pointers.
#15
I can confirm - I have the same broken 'remove' link in views: http://example.com/user/1/relationships/%2Fremove?destination=myfriendspage
Help is much appreciated. Thanks a lot for this great feature. :)
#16
I have been doing updates and I now see the issue @ #15 and #14 above.
the remove link in views is pointing to url:
http://mysite.com/user/1/relationships/%2Fremove?destination=mysitesfrie...
#17
May I kindly ask if any updates on this issue? I did not post but experienced the same issue.
#18
The change status link (specifically 'remove') is pointing to an invalid URL. Can someone point me in the right direction to change it myself? This issue seems to have been happening for a while without any resolution. Where is this link being generated in the backend?
#19
Okay, for anyone experiencing the issue with the remove links not updating, here's how to fix it.
File: /sites/all/modules/user_relationships/user_relationship_views/views_handler_field_user_relationships_status_link.inc
Line 51: Change $values->rid to $values->user_relationships_rid
You might have to do it on line 37 too.
#20
If you have time, can the fix be created as a patch?
I will try your explanation above in the mean time.
Thanks
#21
I unassign this from me for the moment. I looked at the code but think this would need further testing as I can't say if the one or the other variable name is always correct. Maybe we need an if clause?
#22
@Kars-T, thanks for looking at this. Did the original code work for you all along? It must have as I do not recall seeing the error either. Does it depend on the view being of type Node, User, or User Relationship (all of which can be made to use this field)?
#23
I originally wrote this for one of our projects and did test this on our stage. I don't know how frequently this was used during the beta test of the site but at least there where no new bugs in our issue cue. So yes I believe it did work. :)
#24
I get the same error with node view and user view types.