diff options
Diffstat (limited to 'modules/forum/forum.module')
-rw-r--r-- | modules/forum/forum.module | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 23cab35e8..de845a837 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -388,16 +388,16 @@ function forum_update($node) { */ function forum_form(&$node) { $type = node_get_types('type', $node); - $form['title'] = array('#type' => 'textfield', '#title' => check_plain($type->title_label), '#default_value' => $node->title, '#required' => TRUE, '#weight' => -5); + $form['title'] = array('#type' => 'textfield', '#title' => check_plain($type->title_label), '#default_value' => !empty($node->title) ? $node->title : '', '#required' => TRUE, '#weight' => -5); - if ($node->nid) { + if (!empty($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); $form['shadow'] = array('#type' => 'checkbox', '#title' => t('Leave shadow copy'), '#default_value' => $shadow, '#description' => t('If you move this topic, you can leave a link in the old forum to the new forum.')); } - $form['body_filter']['body'] = array('#type' => 'textarea', '#title' => check_plain($type->body_label), '#default_value' => $node->body, '#rows' => 20, '#required' => TRUE); + $form['body_filter']['body'] = array('#type' => 'textarea', '#title' => check_plain($type->body_label), '#default_value' => !empty($node->body) ? $node->body : '', '#rows' => 20, '#required' => TRUE); $form['body_filter']['format'] = filter_form($node->format); return $form; @@ -407,7 +407,7 @@ 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) { + if (empty($node->nid)) { // new topic $node->taxonomy[arg(3)]->vid = _forum_get_vid(); $node->taxonomy[arg(3)]->tid = arg(3); |