Views argument for User is Member
| Project: | Organic groups |
| Version: | 5.x-7.3 |
| Component: | og.module |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Bevan |
| Status: | closed |
This patch introduces a new views argument to allow a view to have an argument for UID that then filters on that users subscription to the nodes in the view. This is useful for creating views to see the groups another user is subscribed to. E.g. 'John's groups' at user/123/groups where user 'John' has UID 123, and John is NOT the user making the request.
This patch also introduces some minor coding style improvements, and some changes to filter descriptions to make them clearer.
The CVS patch includes changes from http://drupal.org/node/194038 and http://drupal.org/node/166244
The SVN patch has the changes covered in this issue exclusively, although it probably won't apply without the above patches applied first.
| Attachment | Size |
|---|---|
| og_views.patch | 11.63 KB |
| og_views.svn_.patch | 5.35 KB |

#1
I want to add warning text like "This argument exposes a user's group subscriptions to other users. Depending on your site, this may be a violation of their privacy. Use thoughfully."
No longer applies cleanly. Sorry. The intent of the patch is good and committable.
#2
Bugger. This patch has come through work on a CivicActions' client's site. I'll re-submit the patch when updates come through...
I assume you want this for head, right? Which is no longer 4.0, right?
#3
Subscribe
#4
HEAD and DRUPAL-5 beacnhes are identical right now and thats the basis for patchers. Right now, they are nearly identical to 5.4.1 except for 1 minor UI fix.
#5
subscribe.
So is group 4.2 now able to do this? To View a user base on the groups that the user is subscribe to? Thanks.
#6
not yet. feel free to have a go at porting the patch though.
#7
Re-rolled for head.
The CVS patch includes the newly re-rolled patch at http://drupal.org/node/166244
The SVN patch excludes it.
(The previously mentioned patch at http://drupal.org/node/194038 is now committed to CVS)
#8
Woops, missed a patched bug.
#9
Attached is a cleaner patch that only adds the new functionality.
@Bevan, please review to make sure I got it right. Also, I noticed a lot of "usability" changes in your patch that has nothing to do with the new feature. Drupal recommends that you try to keep patches to just one issue. If you see "usability" issues, you should probably create a separate issue with just those changes. See http://drupal.org/patch/create "Separating your changes".
#10
Oh, and the new patch applies against the latest version...
#11
thanks doug. please add warning text like i suggested above. also, no need to run db_query_range() when db_query() will suffice.
#12
Attached patch replaces
#13
In fact the patch is working, but it's only showing the communities for the current user = uid collected in the views' argument. If I try to see another user, it's showing nothing (I'm using panels to overcome on user profiles and using this view as a block-panel).
Another thing to be fixed:
'help' => t('Filter for groups that user is subscribed to. User is specified by user ID (integer). This argument exposes a user\'s group subscriptions to other users. Depending on your site, this may be a violation of their privacy. Use it thoughfully.'),line 338, it's needing to put that \' in "user's" to avoid closing the argument.
#14
This patch fixes the quote problem identified by Vuds. I'm marking back to needs review. Could someone else test Vuds claim, that "it's only showing the communities for the current user = uid." Looking at the code, I don't see why that would be the case.
#15
Applied cleanly for me and the escaped slash works as advertised. Marking tested by community...
#16
Committed. Thanks all.
#17
Automatically closed -- issue fixed for two weeks with no activity.