I've been trying to get this module to work with the og_forum module and found that I had to hack the code slightly to stop the og menu block disappearing when clicking on the link for the group's forum. My hack probably isn't good enough to go into the module as a patch, but I thought I would share it back in case anybody else finds it useful.

In the function _og_menu_get_menu_block() I have added a few lines to get a value for $nid when in a forum. Under the lines:

<?php
  // get current node
  if (arg(0) == 'node') {
    $nid = arg(1);
  }
?>

I've added:

<?php
  else if (arg(0) == 'forum') {
    $currentGroup = og_get_group_context();
    $nid = $currentGroup->nid;
  }
?>

I've found OG Menu to be a really useful module so thanks to everyone who has been working on it.

Comments

liamgh’s picture

Status: Active » Closed (fixed)

This patch doesn't seem to be necessary with 6.x-2.0 which is great news, so I will close this bug.

muschpusch’s picture

Version: 6.x-1.3 » 6.x-2.0
Status: Closed (fixed) » Needs review

Sorry liamgh similar issue in og_menu 2.0

188 function og_menu_form_alter(&$form, $form_state, $form_id) {
189   // Node form
190   if (isset($form['#node']) && $form['#node']->type .'_node_form' == $form_id && og_is_group_post_type($form['#node']->type) && $form_id!='forum_node_form') {

At the last condition of the IF statement as a fix...

jide’s picture

Status: Needs review » Closed (won't fix)

I do not really get the issue described by muschpusch. Reopen the issue if needed.