Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I couldn't figure out how to modify the tracker view to add a page for Friends recent posts. Simplest way I could figure out is to extend views_handler_argument_comment_user_uid and transform the incoming user id into the friends user ids. It's relatively simple as it only overrides query() and adds extra_options_form().
If I've missed something obvious, let's hear it. Otherwise I request that this be added to user_relationship_views. Patch is against 6.x-1.0-rc3.
Comment | File | Size | Author |
---|---|---|---|
user_relationships_node_uid_touch_arg_handler.patch | 4.66 KB | cedarm |
Comments
Comment #1
YK85 CreditAttribution: YK85 commentedhello cedarm,
Would your custom views handler help to resolve other issues with UR + Views integration such as:
view with ALL pending requests of CURRENT LOGGED IN USER (sent and received)
view with NON-FRIENDS ONLY of CURRENT LOGGED IN USER (aka FILTER OUT friends)
I would appreciate your help!
Comment #2
cedarm CreditAttribution: cedarm commentedThis patch "Displays *nodes* only if a user relationship posted the node or commented on the node.", so I don't think it's relevant to your issues. If you are trying to create a view of nodes that were either "not posted by a friend or no friends have commented on", something similar to this patch could probably be written. I'd have to think more about the query before saying for sure.
If you're trying to create a view of Users (friends or non-friends), and not of Nodes, you may be able to do it with what UR already provides. It's been a while since I looked at it. Post a support request in another issue.
p.s. Can you try this patch out and report back? I'd like to get it committed.
Comment #3
YK85 CreditAttribution: YK85 commentedyes, sorry for not clarifying. I would like to create a view that shows the fields of the content profile node of users that:
1) does have a relationship with current logged in user
2) does not have a relationship with current logged in user
3) have a pending relationship with the current logged in user (requests sent by current logged in user and received by current logged in user)
I would truly appreciate your help in implementing this views handlers!
Comment #4
robby.smith CreditAttribution: robby.smith commentedGreat work cedarm!
Would you be able to kindly create an additonal arg for 'User relationship nodes' and allow option of relationship is 'approved' or 'pending' or 'no relationship'? I believe this is related to yaz085's request - but this would vastly improve UR and Views integration.
Thanks!
Comment #5
cedarm CreditAttribution: cedarm commentedSorry I don't have any serious time I can put into this right now. Two things need to happen: 1. Figure out what SQL achieves these options, 2. Implement the UI for the options. The UI is relatively easy, if I remember correctly. The SQL may be more tricky. Let's see, the last line of the patch is the meat of what it does:
The $placeholders variable contains '%d,%d,%d,%d' for however many associates the user has (four relationships/friends), while $args is an array of user ids (5,7,20,24,5,7,20,24 for example). The user ids are duplicated because $placeholders is used twice.
I think the pending relationships case is already taken care of. All that needs to happen is limit the list if user ids to non-approved (pending) relationships. This is already built into the UI.
For the no relationships query I think we want
Does this make sense? If so, all we need to do is add a "Negate" option. A simple checkbox would suffice, but I'm thinking for our user's sake it should be two radio buttons that spell out what's what:
Thoughts?
Comment #6
Bilmar CreditAttribution: Bilmar commented+1 subscribing
Comment #7
YK85 CreditAttribution: YK85 commentedkindly bumping - the stuff here seems it will help UR become better =)
Comment #8
mrf CreditAttribution: mrf commentedComment #9
webchickuser_relationships_node_uid_touch_arg_handler.patch queued for re-testing.
Comment #10
jthorson CreditAttribution: jthorson commentedComment #11
mrf CreditAttribution: mrf commented