Currently, the "friends of" argument in Views restricts results to only show content from the argument-user's friends. However, it would be nice to also be able to show content from the argument-user himself, for example a stream of status updates from this user and his friends.
There's also a problem that including $this->ensure_my_table() causes an extra (unnecessary) join. dww explained to me in IRC today that this is due to the difference between explicit and implicit joins in Views... basically the argument already has an implicit join so it doesn't need the explicit one that's added by "ensuring" the table. This is a problem because it produces multiple copies of the same content when the content is from the user who initiated the friendship.
Patch attached. I'm not quite sure what happens if the Allow multiple terms per argument setting is enabled, but other than that it's working for me.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | argument.gif | 35.18 KB | liliplanet |
| #7 | flag_status.txt | 10.21 KB | liliplanet |
| #7 | argument.gif | 42.63 KB | liliplanet |
| #6 | flag_friend_handler_argument_numeric.patch | 2 KB | sirkitree |
| flag_friend_handler_argument_numeric.patch | 1.55 KB | icecreamyou |
Comments
Comment #1
marcoBauli commentedas far as i can see this is only for "user" kind of views, as the "friend of"argument does not appear in other kinds of views.
So this can be in no way a solution to create list of content by friends using views module. Correct?
Comment #2
icecreamyou commentedYou can already create a list of content by friends using Views, but that is unrelated to this issue. This issue assumes you already know how to do that, and it offers a patch to allow the current user's content to show up in that view as well. It is not only for User views. Please keep the issue on topic.
Comment #3
marcoBauli commentedThe purpose of the patch here is to "show content from the argument-user's friends and argument-user himself". As such argument is not allowed in *node* views (only user views) the patch looks wrong to me.
Comment #4
icecreamyou commented"show content" == it works with nodes or anything else. I am personally using it in Facebook-style Statuses views. The patch is not intended to work magic for your specific view to suddenly do whatever you want it to do if you designed the view wrong. All it does is add the argument user's content to whatever content is already being shown if you are using the argument the patch is for and if your view already works.
You are expecting something totally different and very much off-topic.
Comment #5
icecreamyou commentedI forgot a line in the patch. The first line in the options_form() function needs to be this:
Comment #6
sirkitree commentedHere is a re-roll of the patch with the proposed changes. If I can get someone else to test this out on their view and mark it RTBC I'll commit it. Thanks!
Comment #7
liliplanet commentedHi,
So wonderful now have the FB status and FBMP playing together, and now unfortunately still struggling with flag friend.
Please see attached view and screenshot of the argument.
I've tried the filter Facebook-style Statuses: Content from flagged users or the current user, but then only shows current user status.
So much closer to getting this right and will most appreciate any help just to finalize the flag friend please.
Lilian
Comment #8
icecreamyou commentedWhat is the query that your view generates?
Comment #9
liliplanet commentedThank you so much Icecreamyou :)
Comment #10
icecreamyou commentedAre you sure that's it? And for the same view you exported? You're missing the WHERE statements represented by all filters and arguments.
However your problem is probably that you have "By current user" checked in your Relationship instead of "By any user."
This patch is working for me, by the way, but I probably shouldn't be the one to mark it RTBC since I wrote the original.
Comment #11
liliplanet commentedI think I got it! So appreciated Icecreamyou :)
Instead of the php argument, simply validate by 'user id from logged in user'.
Attached screenshot.
Comment #12
icecreamyou commentedGood. I take it that means this is working.
Comment #13
mazdakaps commentedhello this patch works for flag friend 2 too?
Comment #14
sirkitree commentedFlag Friend 2 is a mess and is now unsupported, so no, I doubt it will work for 2.x.
Waiting on git conversion to commit anything else, but this'll be first or second on my list :)
Comment #15
sirkitree commentedCommitted. Thanks!
Comment #16
sirkitree commentedLet's make sure we get this in 7
Comment #17
sirkitree commentedcommitted to D7: http://drupalcode.org/project/flag_friend.git/commitdiff/ca458fecb0b5ed6...