diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2007-03-27 05:13:55 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2007-03-27 05:13:55 +0000 |
commit | f7440d4d73ec57219af232c135be3b2567dda45f (patch) | |
tree | a6b7d947eda1c7bfc2197bfb584f7b17143c97a5 /modules/comment/comment.module | |
parent | f2ca29071fe33603cf22f1603a3e6a61ee9c0814 (diff) | |
download | brdo-f7440d4d73ec57219af232c135be3b2567dda45f.tar.gz brdo-f7440d4d73ec57219af232c135be3b2567dda45f.tar.bz2 |
#130971: Kitchen sink (E_NOTICE compliance / Code style / Bugfix in book toc)
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r-- | modules/comment/comment.module | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 8f060c300..0efe2f6c7 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -384,7 +384,7 @@ function comment_form_alter($form, $form_id) { '#description' => t('Users with the <em>administer comments</em> permission will be able to override this setting.'), ); } - elseif (isset($form['type'])) { + elseif (isset($form['type']) && isset($form['#node'])) { if ($form['type']['#value'] .'_node_form' == $form_id) { $node = $form['#node']; $form['comment_settings'] = array( @@ -1535,7 +1535,23 @@ function comment_form($edit, $title = NULL) { $form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), '#maxlength' => 64, '#default_value' => !empty($edit['subject']) ? $edit['subject'] : ''); } - $form['comment_filter']['comment'] = array('#type' => 'textarea', '#title' => t('Comment'), '#rows' => 15, '#default_value' => !empty($edit['comment']) ? $edit['comment'] : $user->signature, '#required' => TRUE); + if (!empty($edit['comment'])) { + $default = $edit['comment']; + } + elseif (isset($user->signature)) { + $default = $user->signature; + } + else { + $default = ''; + } + + $form['comment_filter']['comment'] = array( + '#type' => 'textarea', + '#title' => t('Comment'), + '#rows' => 15, + '#default_value' => $default, + '#required' => TRUE, + ); if (!isset($edit['format'])) { $edit['format'] = FILTER_FORMAT_DEFAULT; } |