This problem is solved.
In in “bp-groups-filters.php” in function “function groups_add_forum_where_sql( $sql = ” ) ” change the following (oba is the database prefix):
Code:
//Get current user
$current_user = wp_get_current_user();
//Fetch forums IDs to which user has access
$i = 0;
$result = mysql_query("SELECT meta_value FROM oba_bp_groups_members, oba_bp_groups_groupmeta WHERE user_id = ".$current_user->ID." and oba_bp_groups_members.group_id = oba_bp_groups_groupmeta.group_id and oba_bp_groups_groupmeta.meta_key=’forum_id’")
or die ("MySQL-Error: " . mysql_error());
while ( $row = mysql_fetch_array($result)) {
$res[$i] = $row["meta_value"];
$i++;
}
//Implode forum ids into a comma sperated list e.g: 3,5,7
$comma_separated = implode(",", $res);
// Set this for groups
//Old //$parts[‘groups’] = "(gm.meta_key = ‘forum_id’ AND gm.meta_value = t.forum_id)";
$parts[‘groups’] = "(gm.meta_key = ‘forum_id’ AND gm.meta_value = t.forum_id AND gm.meta_value IN (".$comma_separated."))";