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

Terence Westphal - July 13, 2009 - 09:19

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

paulbooker - July 13, 2009 - 21:31
Assigned to:Anonymous» paulbooker

I'll take a look at this tomorrow.

Thanks, Paul

#3

dazweeja - July 15, 2009 - 01:50

I think this should do it Paul (patched against og_forum.module 6.x-2.0-rc1).

AttachmentSize
ogf_507868.patch 845 bytes

#4

dazweeja - July 15, 2009 - 01:51
Status:active» needs review

#5

Janam - July 16, 2009 - 04:23

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

paulbooker - July 16, 2009 - 10:07
Version:6.x-2.0-rc1» 6.x-2.x-dev
Status:needs review» fixed

Thanks for the patch & verification.

I'll get this patch committed to the development branch later today.

Best, Paul

#7

Terence Westphal - July 17, 2009 - 07:46

I can also confirm that the issue is solved by the patch.

#8

seehawk - July 24, 2009 - 03:17

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

dazweeja - July 27, 2009 - 00:46

@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.

AttachmentSize
ogf_507868.patch 615 bytes

#10

seehawk - July 27, 2009 - 18:48

Awesome. Thank you!

#11

sun - July 30, 2009 - 17:01
Status:fixed» closed

I'll move this patch over to #386566: OG Forum incompatible with Advanced Forum.

 
 

Drupal is a registered trademark of Dries Buytaert.