Views argument for User is Member

Bevan - November 30, 2007 - 00:40
Project:Organic groups
Version:5.x-7.3
Component:og.module
Category:feature request
Priority:normal
Assigned:Bevan
Status:closed
Description

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.

AttachmentSize
og_views.patch11.63 KB
og_views.svn_.patch5.35 KB

#1

moshe weitzman - December 2, 2007 - 01:53
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.

#2

Bevan - December 2, 2007 - 20:12
Version:5.x-4.0» 5.x-4.1
Assigned to:Anonymous» 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?

#3

Owen Barton - December 3, 2007 - 00:27

Subscribe

#4

moshe weitzman - December 3, 2007 - 01:41

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

Jkello - December 19, 2007 - 09:41

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

Bevan - December 19, 2007 - 10:30

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

#7

Bevan - December 24, 2007 - 01:59
Version:5.x-4.1» 5.x-4.3

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)

AttachmentSize
196488.patch 6.16 KB
196488.svn_.patch 5.05 KB

#8

Bevan - December 24, 2007 - 02:47
Status:needs work» needs review

Woops, missed a patched bug.

AttachmentSize
196488.patch 6.17 KB
196488.svn_.patch 5.06 KB

#9

douggreen - August 8, 2008 - 13:16

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

AttachmentSize
196488.patch 1.58 KB

#10

douggreen - August 8, 2008 - 13:16
Version:5.x-4.3» 5.x-7.3

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

#11

moshe weitzman - August 10, 2008 - 23:45
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.

#12

douggreen - August 12, 2008 - 23:37
Status:needs work» needs review

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
AttachmentSize
196488.patch 1.72 KB

#13

Vuds - September 10, 2008 - 01:03
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.

#14

douggreen - September 18, 2008 - 14:00
Status:needs work» needs review

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.

AttachmentSize
196488.patch 1.72 KB

#15

arthurf - September 30, 2008 - 11:34
Status:needs review» reviewed & tested by the community

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

#16

moshe weitzman - September 30, 2008 - 15:40
Status:reviewed & tested by the community» fixed

Committed. Thanks all.

#17

Anonymous (not verified) - October 14, 2008 - 15:42
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.