OG forums are not hidden
Janam - July 2, 2009 - 04:14
| Project: | OG Forum |
| Version: | 6.x-2.x-dev |
| Component: | User interface |
| Category: | support request |
| Priority: | normal |
| Assigned: | paulbooker |
| Status: | closed |
Description
Hi,
so all my OG forums are private, but unfortunately anyone can see the containers in the general forum area. Is there anyway to hide the OG forums from users who aren't in that particular group?

#1
I just want to add that I have the same issue as Janam here. Altho I cant remember what previous release (6.x-2.x) it was, I've noticed that this wasn't always the case. It used to be the case that you could only see containers of groups you where member of. Does anyone remember what dev version (date of publication) still worked that way?
#2
I'll take a look at this tomorrow.
Thanks, Paul
#3
I think this should do it Paul (patched against og_forum.module 6.x-2.0-rc1).
#4
#5
awesome patch, really helpful. THANK YOU SO MUCH.
Btw I was wondering if this functionality will be added in the next version of OG Forums?
#6
Thanks for the patch & verification.
I'll get this patch committed to the development branch later today.
Best, Paul
#7
I can also confirm that the issue is solved by the patch.
#8
I'm having this issue on RC3, which has the same date as the development branch. Is the patch in place on RC3, or just dev?
I'm also using the Advanced Forums module, in case that's relevant, but I think that module only handles look-and-feel.
#9
@seehawk, replace the function og_forum_preprocess_forums in og_forum.module (lines 1684-1696) with this function:
function og_forum_preprocess_forums(&$variables) {if (!empty($variables['forums'])) {
$forums = og_forum_get_forums($variables['tid']);
$variables['forums'] = theme('forum_list', $forums, $variables['parents'], $variables['tid']);
}
if (isset($variables['links']['forum'])) {
global $user;
if (!in_array($variables['tid'], variable_get('forum_containers', array())) && ($variables['tid'] != 0)) {
$gid = og_forum_gid_from_tid($variables['tid']);
//group forum link with group selected
if (!empty($gid) && array_key_exists($gid, $user->og_groups)) {
$variables['links']['forum']['query'] = array('gids[]' => $gid);
}
}
}
_og_forum_set_breadcrumb($variables['tid']);
}
Make sure you empty your caches afterwards. Patch attached that does the same thing.
@Paul, this code should have been in the patch in #30 of #386566: OG Forum incompatible with Advanced Forum. It was in the the patch in #29 but I must have made a mistake while re-rolling. Sorry.
#10
Awesome. Thank you!
#11
I'll move this patch over to #386566: OG Forum incompatible with Advanced Forum.