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.
| Comment | File | Size | Author |
|---|---|---|---|
| og_forum.patch | 11.03 KB | csavio |
Comments
Comment #1
csavio commentedThink this should have been set to needs review.
Comment #2
alexrayu commentedApplying this patch breaks module logic with the condition block wherein it is contained.
Comment #3
csavio commentedCould 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?
Comment #4
Wolfflow commentedsubscribe
Comment #5
vegantriathlete