Show group context block if displaying forum nodes

freddyseubert - June 12, 2009 - 12:10
Project:OG Forum
Version:5.x-2.6
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi there! To reach a compromise for my "won't fix"-issue here: 413252, I want the group context block to show up on every single node display of a group related forum node. When I examined the module i found this:

<?php
     
// If we're viewing a forum post in a group forum, set that
      // group as the context.
     
if ($page && $node->og_groups && $node->type == 'forum') {
       
og_set_group_context(node_load($node->og_groups[0]));
?>

So the group context should be set if the forum node belongs to a group forum, right?
But the OG context block doesn't show up in my case.
Am I missing something? Is this a thing to adjust in the settings (block, og or og_forum settings?)?

any help is appreciated!

Freddy

#1

freddyseubert - June 12, 2009 - 12:12

Sorry, the the link to the related issue was not set automatically, so there it is: http://drupal.org/node/413252

#2

cwells - June 29, 2009 - 20:35

I am also seeing this behavior in Drupal 6. In my case, $node->og_groups is an empty array. Digging into og.module, og_get_node_groups_result runs the following query:

SELECT oga.group_nid, n.title FROM node n INNER JOIN og_ancestry oga ON n.nid = oga.group_nid WHERE oga.nid = 91

91 is the nid of my forum post. There are NO entries in og_ancestry for that nid. Should og_forum be inserting into og_ancestry when a node is created (nodeapi, op = insert)?

So, I went up to content types and under the group settings for the content type "forum topic" set it to "standard group post." This inserts the entries into the og_ancestry table. I didn't see anything in the README.txt file regarding setting this, but it seemingly needs to be set to set the group context. Is it supposed to be required that you go to the "forum topic" content type and edit the group settings to make a forum topic a standard group post? There's nothing about it in the README, so it might deserve some special attention (or, am I missing something else?)

#3

freddyseubert - July 1, 2009 - 09:53

Tried that as well (setting the forum post content type to "standard group post") - had no effect on drupal 5.

But if this is the way to make it work on d6, it should be included either in the readme or somewhere else.

 
 

Drupal is a registered trademark of Dries Buytaert.