When building a view to show content that applies to a user, it's often helpful to filter that content with the "Organic Groups: Groups" filter. By exposing this filter to the user, the user can choose the groups that interest them. Unfortunately, the exposed filter currently includes ALL groups on the entire site, not just the ones the user is a member of. It would awesome to have an option to reduce the list of group in the exposed filter to include the groups that the user is a member of only. This patch extends the existing group_nid filter handler to add this functionality. See screenshot.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

d0ublej0’s picture

Thank you! The filter works great!

Grayside’s picture

Status: Needs review » Closed (works as designed)

1. Add relationship for group node of post.
2. Add argument for member of group with that relationship, defaulted to current user.

jvieille’s picture

Version: 6.x-2.x-dev » 6.x-2.4
Status: Closed (works as designed) » Active

I have exactly the reverse problem: the filter only shows the groups the user is member of, which is not correct as this prevents to query unrestricted nodes of these groups.
Actually, I get an "illegal choice" error for non admin users as the filter is set to select all groups by default

Basically, it seems that OG does what quicksketch is asking for : restricting the user to select groups he is not member of in views exposed filters - which is not an expected default behavior.

In og_module for function og_all_groups_options(), it is stated

Get a list of all groups accessible to the current user for posting

But I am not sure it is the case, I do not see any user restriction in this function.

Is there something wrong in my site, or is this really an intentionnaly designed béhaviour?

Thanks for help

kim-odisee’s picture

Issue summary: View changes

Is this available in og-7.x-2.x?