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.

Comments

moshe weitzman’s picture

Status: Needs review » Needs work

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.

Bevan’s picture

Version: 5.x-4.0 » 5.x-4.1
Assigned: Unassigned » Bevan

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?

owen barton’s picture

Subscribe

moshe weitzman’s picture

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.

Jkello’s picture

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.

Bevan’s picture

not yet. feel free to have a go at porting the patch though.

Bevan’s picture

Version: 5.x-4.1 » 5.x-4.3
StatusFileSize
new5.05 KB
new6.16 KB

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)

Bevan’s picture

Status: Needs work » Needs review
StatusFileSize
new5.06 KB
new6.17 KB

Woops, missed a patched bug.

douggreen’s picture

StatusFileSize
new1.58 KB

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".

douggreen’s picture

Version: 5.x-4.3 » 5.x-7.3

Oh, and the new patch applies against the latest version...

moshe weitzman’s picture

Status: Needs review » Needs work

thanks doug. please add warning text like i suggested above. also, no need to run db_query_range() when db_query() will suffice.

douggreen’s picture

Status: Needs work » Needs review
StatusFileSize
new1.72 KB

Attached patch replaces

  • db_query_range with db_query
  • (hopefully) fixes a bug in that query replacing $query for $a2 (I admit I didn't test this, but $a2 looks right)
  • adds the warning you suggested
Vuds’s picture

Status: Needs review » Needs work

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.

douggreen’s picture

Status: Needs work » Needs review
StatusFileSize
new1.72 KB

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.

arthurf’s picture

Status: Needs review » Reviewed & tested by the community

Applied cleanly for me and the escaped slash works as advertised. Marking tested by community...

moshe weitzman’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks all.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

niklp’s picture

Version: 6.x-2.x-dev » 6.x-2.0
Assigned: Unassigned » Bevan

This is not present in 6.x-2.x! Just spent a *serious* amount of time trying to work out how to achieve this...

Going to look at the patch and see what gives.

greg.harvey’s picture

Version: 5.x-7.3 » 6.x-2.x-dev
Assigned: Bevan » Unassigned
Status: Closed (fixed) » Active

*mumble* *grumble* NikLP beat me to it... =/

niklp’s picture

Version: 6.x-2.x-dev » 6.x-2.0
Assigned: Unassigned » Bevan

Nope. No idea...

niklp’s picture

Version: 6.x-2.0 » 6.x-2.x-dev
Assigned: Bevan » Unassigned

I did *not* reassign that - must have been using back button and form settings stuck. Sorry Bevan! :)

niklp’s picture

Version: 6.x-2.0 » 6.x-2.x-dev
Assigned: Bevan » Unassigned

So. Nada. In which case, I present some choices:

1) You fool! This is already available but is cleverly disguised as "feature x"
2) This isn't in 6.x, because of a glaring omission
3) This was taken out of 6.x because of security / niche use case
4) We need a new patch for 6.x

Someone tell which it is at least, so I know where to place my efforts? :)

webkenny’s picture

I agree. This is a needed aspect especially if you are using Views for nodereferences. I wonder if maybe it is somewhere else. Hmmmmm.

niklp’s picture

Status: Active » Closed (fixed)

Ugh. This is actually covered by the "Organic groups: Member of a group" thing - assign this as an argument, pass in a uid and you will have access to all the group data that this uid is a member of. Filters etc all work as normal.

Normal service may now be resumed. Would have been nice if someone could have mentioned this two weeks ago tho :/

Bevan’s picture

NikLP; this is in the the "Organic groups: Member of a group" argument settings. But you know that already now. ;p

Sorry I didn't answer 2 weeks ago. I was offline...