Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Rosamunda’s picture

subscribing. Totally agree.

moshe weitzman’s picture

Status: Needs review » Needs work

Just from a quick code review. You have to filter for only published groups in value_options method. Further, you can just use node table and filter for the group content types. Would avoid a JOIN.

ariflukito’s picture

FileSize
2.19 KB

ok here is the updated one.

ariflukito’s picture

Status: Needs work » Needs review
AfterSys’s picture

seems working, patched to latest stable OG (6.x-1.3) without a hitch, im using this on a dev site and if i notice anything wrong ill post here, i should have it hammered enough after a week from today
code is simple enough and should really go into OG, ive wasted precious hours trying to figure this out with what was provided default by OG..

abaddon’s picture

Version: 6.x-2.x-dev » master

(comment removed - probably posted to the wrong issue)

moshe weitzman’s picture

Status: Needs review » Needs work

doe this get pending members also? that should be an option, no?

ariflukito’s picture

This one just filter a list of users by certain group, if you want to filter the list without pending members shouldn't it be provided by a new filter?

moshe weitzman’s picture

no - filters can have settings and we should use them in order to avoid too many filters

ariflukito’s picture

but I think it doesn't make sense to put the setting on this filter, you can have settings but you can't expose them. OK maybe it makes sense if you don't expose the filter, you can filter pending/active users from certain group but if you want to expose this filter this setting is not really useful. Anyway looking at this handler og_views_handler_field_og_uid_groups, it displays the group regardless the user is a pending member or not. I just want to have filter based on what displayed on this field.

dugh’s picture

Pending members aren't members of the group yet. If that option was wanted, it should be a new issue posted.

See also this issue and its patch: http://drupal.org/node/507770

Owen Barton’s picture

Status: Needs work » Needs review

Attached is a patch (rediffed to remove fuzz) from brian.schilt at #507770: og_views: filter users by group (which I marked as a duplicate).

This works for me - since this is already very useful, I agree that adding settings for pending would perhaps be better as a subsequent patch.

afox’s picture

Patch has been working for our site for months now, no reports on errors. Should this be considered RTBC or should we wait for pending members patch? Comments anyone?

YesCT’s picture

how is this different than the

(Group node (member)) Organic groups: Group types

filter?

YesCT’s picture

in #12 Owen says there is a patch attached (rediffed) but there is no attachment... ?

amitaibu’s picture

Version: master » 6.x-2.x-dev
Status: Needs review » Active

The patch that exists in #3 is already covered by og_views_handler_filter_og_type. Reseting back to "Active" until a proper patch is provided.

bryancasler’s picture

Can anyone provide an update on the status of this patch?

msonnabaum’s picture

FileSize
1.73 KB

Here's a re-rolled version of the patch from #507770: og_views: filter users by group that should apply cleanly to the latest OG.

Seems to be working fine for me so far.

amitaibu’s picture

Status: Active » Needs work

Files are missing? Where the file holding og_views_handler_filter_og_uid_nid() ?

msonnabaum’s picture

Good call. Forgot to fakeadd it.

rdiazjokyo’s picture

hey any update on this patch? #20 doesn't seem to be working for me. this filter shows up as an option:

Organic groups: Group
OG: Members that belong to a group

but once I choose the filter, it doesn't produce any query results. all results are hidden.

I'm trying to make a "directory" listing of content profiles, where there can be an option to filter users by group membership.

Any updates or guidance would be much appreciated.

rdiazjokyo’s picture

never mind. it works perfectly as a user view, not a node view. i just used a content profile relationship to get it to work perfectly.

chellman’s picture

Patch #20 did just what I was looking for.

bryancasler’s picture

I can also confirm that #20 works for me

geerlingguy’s picture

Status: Needs work » Reviewed & tested by the community

I can confirm that the patch in #20 applies cleanly, adds in the "Organic Groups: Group" filter for views.

Please commit, so I can have an unpatched og install :D

Dp-Mtl’s picture

Hi all, thank for patch. Patch #20 works for me very well!

My job is to assign tasks to the users in another group, and I need a users optionts made by views. At the begining I used user roles as a "filter", and assigned all users in some other group with some role, but it was proved not good. I need a "group" filter.

so I'm lucky here having a good patch.

I applied the pacth and I had filter such like "Organic groups: Group = some other group", So far so good!

I keep working with module very well with user admin. But when I finished all that, I found it did not work with other users. I knew it's so dificult to get through in short time. But finaly, I found out I was using module Spaces, and I found the permission "view users outside groups", that is just so simple!

Now every thing is perfect.

mrwhizkid’s picture

Thank you so much! A very useful patch and a useful filter. Just what I needed.

Rosamunda’s picture

Please commit this VERY useful patch!!! :)

amitaibu’s picture

+++ modules/og_views/includes/og_views_handler_filter_og_uid_nid.inc	25 Jul 2010 20:41:17 -0000
@@ -0,0 +1,12 @@
+    $this->value_options = $this->allowed_values();
...
+  // Get allowed values from hook_allowed_values(), if any,
+  // or from content_allowed_values();
...
+    return og_all_groups_options();

1) Is this comment relevant?
2) Can't we just have $this->value_options = og_all_groups_options();

Powered by Dreditor.

amitaibu’s picture

+++ modules/og_views/includes/og_views_handler_filter_og_uid_nid.inc	25 Jul 2010 20:41:17 -0000
@@ -0,0 +1,12 @@
+    $this->value_options = $this->allowed_values();
...
+  // Get allowed values from hook_allowed_values(), if any,
+  // or from content_allowed_values();
...
+    return og_all_groups_options();

1) Is this comment relevant?
2) Can't we just have $this->value_options = og_all_groups_options();

Powered by Dreditor.

amitaibu’s picture

+++ modules/og_views/includes/og_views_handler_filter_og_uid_nid.inc	25 Jul 2010 20:41:17 -0000
@@ -0,0 +1,12 @@
+    $this->value_options = $this->allowed_values();
...
+  // Get allowed values from hook_allowed_values(), if any,
+  // or from content_allowed_values();
...
+    return og_all_groups_options();

1) Is this comment relevant?
2) Can't we just have $this->value_options = og_all_groups_options();

Powered by Dreditor.

bschilt’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
2.24 KB

Here is a new patch with the changes applied that @amitaibu suggested. Its essentially the same as the patch in #20. I've tested and it works well.

@amitaibu, can we get this committed to at least the dev branch soon? I'm doing some views integration work with the og_subgroups module and once this patch has been committed I can finish my work with subgroups by replacing the flat group select box with the subgroup hierarchy selector.

Jarada’s picture

Version: master » 6.x-2.x-dev

*Bump* Any progress on this commit?

afox’s picture

Status: Needs review » Reviewed & tested by the community

I've tested this patch with couple sites already with no problems. I think it definitely need to be committed! I'm marking it RTBC - if new issues rise up, create new topics.

geerlingguy’s picture

Yes - please commit :-)

Sansui’s picture

Very cool patch, very similar to a filter I would like to have in OG.

However, instead of choosing from a static list of group options in the filter to filter for/against, I would like to be able to filter against the current group node provided by argument. Is it possible to use argument as a filter option?

Example use: Filtering out users that are members of the group node

mattgilbert’s picture

subscribe

Grayside’s picture

Status: Reviewed & tested by the community » Needs work

@Sansui we could add an option that uses the current group node from context.

Why does the patch add 'field' => 'nid', to a seemingly unrelated handler?

jeffschuler’s picture

Status: Needs work » Needs review
FileSize
8.48 KB
1.49 KB

This patch removes that 'field' => 'nid' that Grayside refers to, which actually adds a spurious item to the fields list called "n", (in group "n" with description "n".) See attached screenshot.

Grayside’s picture

Status: Needs review » Needs work

Could someone describe the View for which this would be used? 5 minutes of poking around Views UI and I haven't seen it yet.

+++ b/modules/og_views/og_views.views.incundefined
@@ -413,6 +416,10 @@ function og_views_data_og_uid() {
+      'help' => t('OG: Members that belong to a group'),

Help should end in a period.

Grayside’s picture

Status: Fixed » Closed (fixed)

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

Delty’s picture

Status: Closed (fixed) » Needs review

Could someone please check on this? As far as I can tell, this patch never actually got committed - the portion intended for og_views.views.inc isn't in the current dev at least.

Thanks,
-=Delty

HongPong’s picture

*bump* yeah I think that the patch on #39 did not actually get in - not having luck filtering this way on a user view . The string "OG: Members that belong to a group" is not in og_views.views.inc .

Maybe I'm crazy but I don't find this stuff on 6.x dev og_views.views.inc:

+    'filter' => array(
+      'handler' => 'og_views_handler_filter_og_uid_nid',
+      'help' => t('OG: Members that belong to a group'),
+    ),
+  );

Could someone review this?

soulfroys’s picture

I checked in comment # 41 that has been committed only part of the patch in # 39 (the file og_views_handler_filter_og_uid_nid.inc only).
I created a new patch (against the last DEV) with the rest of the code and it worked as expected!

This is a great addition to this module! I hope I have contributed in some way... (Sorry for my bad English)

Status: Needs review » Needs work

The last submitted patch, og-filter_users_by_group-405546-45.patch, failed testing.

Grayside’s picture

Status: Needs work » Fixed

http://drupalcode.org/project/og.git/commit/cb50af6

Ah, looks like a Git fail. Thanks for the patch!

Status: Fixed » Closed (fixed)

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

sgtsaughter’s picture

Issue summary: View changes

Can anyone explain how to configure this? I'm looking to have an exposed filter for a User View Type by the groups that the user is in (i.e. only show me users that belong to a selected group).

@Grayside, I'm not seeing the code in comment #47 in the latest version of og. Was it removed? I see from the release notes of 6.x-2.3 that it was added

New Views handlers: Filtering users by group, filter and sort by group description.

but I don't see the code in there either.

Thanks.