summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/comment.module20
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;
}