Posted by ariflukito on March 18, 2009 at 1:12am
24 followers
| Project: | Organic groups |
| Version: | 6.x-2.x-dev |
| Component: | Og Views |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
This patch adds a views filter that can filter users by group. I think this fixes #371628: Views filter "Group member" not working as expected.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| og_views_group_filter.patch | 2.1 KB | Idle | FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in og_views_group_filter.patch. | View details |
Comments
#1
subscribing. Totally agree.
#2
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.
#3
ok here is the updated one.
#4
#5
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..
#6
(comment removed - probably posted to the wrong issue)
#7
doe this get pending members also? that should be an option, no?
#8
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?
#9
no - filters can have settings and we should use them in order to avoid too many filters
#10
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.
#11
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
#12
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.
#13
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?
#14
how is this different than the
(Group node (member)) Organic groups: Group types
filter?
#15
in #12 Owen says there is a patch attached (rediffed) but there is no attachment... ?
#16
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.
#17
Can anyone provide an update on the status of this patch?
#18
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.
#19
Files are missing? Where the file holding og_views_handler_filter_og_uid_nid() ?
#20
Good call. Forgot to fakeadd it.
#21
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.
#22
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.
#23
Patch #20 did just what I was looking for.
#24
I can also confirm that #20 works for me
#25
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
#26
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.
#27
Thank you so much! A very useful patch and a useful filter. Just what I needed.
#28
Please commit this VERY useful patch!!! :)
#29
+++ 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.
#30
+++ 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.
#31
+++ 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.
#32
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.
#33
*Bump* Any progress on this commit?
#34
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.
#35
Yes - please commit :-)
#36
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
#37
subscribe
#38
@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?#39
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.#40
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.
#41
http://drupalcode.org/project/og.git/commit/3fc1e7d
#42
Automatically closed -- issue fixed for 2 weeks with no activity.