diff options
Diffstat (limited to 'modules/forum.module')
-rw-r--r-- | modules/forum.module | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/modules/forum.module b/modules/forum.module index 7e36b4087..3aae6b469 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -587,11 +587,7 @@ function forum_update($node) { function forum_form(&$node) { $form['title'] = array('#type' => 'textfield', '#title' => t('Subject'), '#default_value' => $node->title, '#required' => TRUE); - if (!$node->nid) { - // new topic - $node->taxonomy[] = arg(3); - } - else { + if ($node->nid) { $forum_terms = taxonomy_node_get_terms_by_vocabulary(_forum_get_vid(), $node->nid); // if editing, give option to leave shadows $shadow = (count($forum_terms) > 1); @@ -606,6 +602,16 @@ function forum_form(&$node) { } /** + * Implementation of hook_prepare; assign forum taxonomy when adding a topic from within a forum. + */ +function forum_prepare(&$node) { + if (!$node->nid) { + // new topic + $node->taxonomy[] = arg(3); + } +} + +/** * Implementation of hook_insert(). */ function forum_insert($node) { |