OG Views: cannot create view of all groups of which I am *not* currently a member
| Project: | Organic groups |
| Version: | 6.x-2.0 |
| Component: | Og Views |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
This is either a feature request or a support issue - I apologize if it's the latter.
I would like to create a view showing only those groups of which I am not already a member (or a pending member). However, the obvious way of doing this (take the og_my view and change the filter "Organic groups: Group member" to false) does not work.
The reason is that the SQL query essentially returns one row for every user in the group that matches your conditions. If you're searching for yourself (as in og_my), each group node will only show up once; if you're not searching for yourself, each group node shows up N times, where N is the number of other group members. Thus the groups of which I'm already a member continue to be displayed as long as there's at least one other member.
Does anyone have a way around this?
Thanks, Adrian

#1
You may not be able to achieve this in Views directly, as it does not support subqueries. My SQL came out like so:
SELECT node.nid AS nid, node.title AS node_title FROM node node LEFT JOIN og_uid og_uid ON node.nid = og_uid.nid WHERE (node.type IN ('campaign','setting','system')) AND node.nid NOT IN (select nid from og_uid where uid = 1);
It is said you can programmatically forward the results of such a query into the Views system for theming.
Maybe a special handling of the argument Organic Groups:Member of a Group, Exclude Argument option?
#2
Hi,
Did you find a solution for this?
I'm struggling
Cheers
Zap
#3
Hi,
the same problem. WHERE (og_uid.uid <> ***CURRENT_USER***) doesn't seem to work.
Thanks,
JP
PS. I would like to have a panel page where the user can see in the left column of which groups s/he is member and in the right column the groups s/he potentially can join.