The default "user_relationships_content" view doesn't seem to work for any one-way relationships. I have two relationship types - "friend" (two way) and "fan" (one way). When I use the "user_relationships_content" view, it only shows me content from people that I have a "friend" relationship with.
This is an issue I've been struggling with for many weeks now, and is keeping me from being able to fully embrace Use Relationships on a site that I need to go live very soon. I have not found any other method of pulling nodes created by people I have a one-way relationship with.
Please help!
| Comment | File | Size | Author |
|---|---|---|---|
| #35 | user_relationship.patch.txt | 7.24 KB | Hardik C |
| #15 | user_relationships_views_revers_455792.patch | 6.55 KB | EdinburghRob |
| #15 | Screen shot of new relationship.png | 46.89 KB | EdinburghRob |
| #2 | from-requestees.view_.php.txt | 5.26 KB | alex.k |
Comments
Comment #1
bob jk commentedComment #2
alex.k commentedTry this starter view - it works with any relationship type. Be aware that it shows only one direction for one-way relationships.
Comment #3
gallamine commentedalex.k,
Thanks for the response. Perhaps I'm not understanding things here, but this View seems to have the same behavior as the default "user_relationships_content" view. Maybe the key is your statement, "Be aware that it shows only one direction for one-way relationships." I'm not exactly sure what this means, or what the implications may be.
How about some examples:
I'm user, "gallamine". I've clicked "become username's fan" link for several different users. Now, when I view their profiles the link says, "fan (You to Them)". Ok. So, from my perspective, I now am now fans of many users, each with content, and I'd like to get a list of all the content published by those users. It would seem that the default View should retrieve this information, but it doesn't.
So, another specific example. My (user id #1) list of relationships is as follows:
Ok, so now if I use the view you provided above, and I look for all the content created by relationship type "fan" for user ID #1 (1 is the argument to the view preview), I get the following list:
As you can see, it only shows content for users with which I have BOTH a "friend" and a "fan" type relationship.
Perhaps part of my problem comes from the fact that I'm doing this as the administrator?
Comment #4
scalp commentedIs there any way to get this working? Without one-way relationships showing up in the view, what's the purpose of having one-way relationships?
Comment #5
scalp commentedIs there a view that can accomplish this? I recently upgraded to the dev version to test something out that alex.k had fixed (which he did wonderfully!) and I can't get a view to work that shows nodes from users that a user is following (1-way relationship that doesn't require approval). The one provided in comment 2 doesn't do the trick. I can't remember if I ever got it working right before the upgrade or not. I know the module is keeping track correctly of users that user A is following because the block showing them is correct. There just doesn't seem to be a way to pull info about them into views. Thank you.
Comment #6
sterwa commentedsubscribe
Comment #7
bflora commentedSubscribe. I'm a little bummed out to see that this isn't possible with UR.
Comment #8
bflora commentedNot 100% sure if this solves your problem, but I was able to build a view that does what you're trying to do.
To do so, I had to patch the user_relationship_views.views.inc file.
here's what I did:
1. In your user_relationship directory, find user_relationship_views/user_relationship_views.views.inc file
2. Open it in an editor.
3. Go to line 26.
4. Change the word "requester" to "requestee."
5. Save and close the file.
6. Create a new view.
7. Add a "relationship" to the view: "User Relationship: Requestee user"
8. Add an argument to the view: "User Relationships: Requester user"
9. Under "action to take if argument not present" select "Provide default argument" and under that, select "User ID from logged in user"
10. Set the validator to "user" and choose "allow both numeric and string IDs
11. Save the argument.
12. Set a path for where you want this view to show up using the controls in the views editor.
13. Save the view.
14. Voila!
Here's an export of the view that I made:
Remember you have to patch the file before this will work properly. Good luck!
Comment #9
mherb204 commentedTHANK YOU! enough said!
Comment #10
likewhoa commentedbflora this works for Fan "(You to Them)" but not the other way around.
Comment #11
bflora commentedI can only speak to my use case. I never thought about wanting to see the latest nodes from people following you. That might be kind of interesting.
Comment #12
sterwa commentedThanks bflora, your fix from #8 worked for me.
Comment #13
bflora commentedHappy to help!
Comment #14
cerup commentedbflora, are there any side affects to changing the file? I posted a bug report here: http://drupal.org/node/806732 since I found the same problem (before finding this). If there are no side affects and it's indeed a bug, we should try to get it committed.
Comment #15
EdinburghRob commentedHi @cerup, I think there would be a side affect. I had the same problem. The code change in #4 fixes this issue, but also breaks other views.
Basically, for some use cases you want to join on the requester_id field and sometimes on the requestee_id field.
I therefore added another relationship 'User relationships reversed' which this change in it. (see screen shot)
I've only just started using the user_relationship module and I'm no views expert, so I think this patch needs some work. For instance, this patch doubles the number of possible arguments and filters.. but I'm sure some of these combinations don't make any sense.
Anyway, here's the patch.
Comment #16
ajayg commentedComment #17
iknowbryan commentedI have tried the solution #8 but no luck. Plus you have to hack the UR module! Also - I don't want this to work just for the currently logged in user. I need it to be based on the user you(anyone) is viewing. Meaning, if I goto /user/4/following I can see a list of content of the user that user/4 is following.
This seems like a pretty vital feature of the UR module. Being able to view content from the users you follow is ALL i need this module for.
Are there any other updates or any progress on this?
thanks!
-=b=-
Comment #18
mrf commentedI can confirm there is something not working correctly here.
Here are the steps I followed to reproduce this bug locally that can be used for testing any patches or new views designed to fix this.
This will give you the correct listing of all nodes created by these users.
Compare that list to the list at user/my user id/associates and you get a very different list.
Comment #19
mrf commentedClosed #806732: user_relationships_content view is broken as a duplicate, but there is some useful information there about this issue.
Comment #20
galis007 commentedHas there been any head way regarding this
Comment #21
iknowbryan commentedReally?! No one has any idea?
I have tried so many other options but cant seem to get what I need. I wish I knew enough to write my own modules but don't have the chops yet.
Here is exactly what I need - if anyone knows of how to do this with UR OR with any other module you would get a gold star!
1) One way relationship with any user on the site (become a fan)
2) then a view of the content that a user is a fan of. This is not just MY fan's content (that is handled well in the friendlist activity feed) I need to be able to go to anyones user page and see a list of content from user of which THEY are a fan. ie. I'm user 3 but I go to user/4/activity and see content from user 6, 8, and 2 because those are the users that user 4 is a fan of.
If UR was not BROKEN! It would be the perfect solution. But I don't know enough to fix it to display the content from a one-way relationship.
ANY ANY ANY help would be great... thanks
-=b=-
Comment #22
bflora commentedI posted how to do it up in comment #8. Follow the directions.
Comment #23
mrf commentedIt seems it is necessary to modify the default relationship (as in views relationship) to get this type of view working properly (see: Comment #8). This gives you essentially the same result as modifying the query directly to use the requestee id at the correct time (see: #806732: user_relationships_content view is broken)
Should we create a new UR views relationship specifically for one way relationships (see: Comment #15), or is there a way to modify the existing relationship and still allow current views to work properly (including custom views not provided by UR)? The major downside to creating a new relationship is that it becomes even more confusing than it already is when trying to decide which relationship to use.
To get this committed we'll need a patch that includes a working one way view as well as any necessary modifications to the views relationships. That patch will need to be tested very thoroughly especially on custom views using the current relationships.
Ideally any patch would also fix the current content view to not show incorrect content for 1 way relationships but that is not completely necessary if the new view is documented well.
Comment #24
iknowbryan commentedAs I said before I tried #8 with no luck. I modified the code and imported the view provided
created the one-way relationship
then made some connections
going to the page link did not show anything...
and like mrf said - it breaks the rest of the module
Seems like this is a key feature for UR - would be great if this could get patched!
-=b=-
Comment #25
galis007 commentedsuscribe
Comment #26
scalp commentedHas anyone gotten this to work? I tried #8, but as others have mentioned it doesn't work (not sure if the file has changed since only "line 26" is mentioned).
There's been enough ongoing desire for this that it seems worthy of attention. If it would help out, I would be more than willing to offer a small bounty and any help I could offer in development toward a solution.
Comment #27
mrf commentedMarked #504926: How to build View of User PLUS Users Friends' content, #627928: Create a view of my relationships' content, and #1020882: Join error on view filter? as duplicates of this issue.
Comment #28
mrf commentedConfirmed that the view is still not showing the expected results in 7.x
Moving this to 7.x, 6.x is in maintenance mode and it would be great to solve the problem in 7 where there is a little more flexibility to include any necessary changes and then backport the solution.
Comment #29
nikkubhai commentedIn my case its not working even for two way relationships
Comment #31
AlexeyB commentedSubscribing!
Really need View for one-way relashionships.
Comment #32
mrf commentedClosed #671734: Create a view of my relationship's nodes? as a duplicate but have a look at that issue for a view export that purportedly solves this problem.
Comment #33
mrf commentedWe have a large patch in the queue to help solve a major issue with one-way relationships. Please review if you have a chance so we can move forward with some of these related issues.
#651502: clarify reciprocal & one-way relationships
Comment #34
dbrouard commentedHi all. I've get to this issue with the same problem as the other ones. If I've understood all the thread, there's no way right now to do:
1. Create a one-way relationship.
2. Create a view which nodes are filtered to show just them which users are related to the logged user.
In other words, Twitter.
I works for me if I use a reciprocal relationship but I need a one-way one.
There's no way to do this?
Is there any plan to solve this?
Can I do anything to help?
Thanks in advance!
Comment #35
Hardik C commentedHi,
Please apply the attached patch,it may be helpful to you.
Regards,
Hardik