I have a potential patch for creating subforums within the top level container if it is used. Previously the check for a default container prevented any of the forum/container code Josh Cohen had written from being used for when something was put in at the top level. It seems like this could be removed and allow subforums to be created even when a default container is specified.

Basically all it does is take the portion of code here:

    if ($default_container_yn) {
          $edit = array('name' => $node->title, 'vid' => og_forum_get_vid());
          $default_container = variable_get('forum_default_container', 0);
          $edit['parent'] = array($default_container);
          unset($edit['tid']);
          $status = taxonomy_save_term($edit);
          db_query('INSERT INTO {og_term} (tid, nid) VALUES (%d, %d)', $edit['tid'], $node->nid);
        }
        else {

And replaces it with the following:

       if ($default_container_yn) {
          $default_container = variable_get('forum_default_container', 0);
          $edit['parent'] = array($default_container);
        }
        $status = taxonomy_save_term($edit);

This should allow all of the container and subforum creation to occur even for groups with a default container and by only adding a parent if the default container is there shouldn't remove any functionality from the existing structure.

The patch is a bit hard to read because the indentation changed by removing the if/else clause and I apologize in advance for that. Thanks for taking a look.

CommentFileSizeAuthor
og_forum.patch11.03 KBcsavio
og_forum.patch10.94 KBcsavio

Comments

csavio’s picture

Status: Active » Needs review

Think this should have been set to needs review.

alexrayu’s picture

Applying this patch breaks module logic with the condition block wherein it is contained.

csavio’s picture

Could you give a bit more detail as to what was the issue you were seeing was? Did you apply the patch and see a problem?

Wolfflow’s picture

subscribe

vegantriathlete’s picture

Version: 6.x-2.2 » 6.x-2.x-dev
Status: Needs review » Closed (won't fix)