summaryrefslogtreecommitdiff
path: root/modules/forum
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-01-31 15:49:26 +0000
committerDries Buytaert <dries@buytaert.net>2007-01-31 15:49:26 +0000
commit05a708fb06137758cf7a15a623b4813af2fc005f (patch)
tree6ae6f50edbcb601329805cbbd7c22d11340327e3 /modules/forum
parent4c9fc80fc48608982a731b03655b02e5ccdb6b17 (diff)
downloadbrdo-05a708fb06137758cf7a15a623b4813af2fc005f.tar.gz
brdo-05a708fb06137758cf7a15a623b4813af2fc005f.tar.bz2
- Patch #112715 by chx, webchick, asimmonds, et al: fixing E_ALL notices. Thanks.
Diffstat (limited to 'modules/forum')
-rw-r--r--modules/forum/forum.module8
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);