diff --git a/modules/comment.module b/modules/comment.module index be7aab813b7..637e04e5b06 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -496,7 +496,6 @@ function comment_reply($nid, $pid = NULL) { } else if (user_access('access content')) { $output .= node_view($node); - $pid = 0; } // should we show the reply box? @@ -1350,7 +1349,7 @@ function comment_form($edit, $title = NULL) { // Only show post button if preview is optional or if we are in preview mode. // We show the post button in preview mode even if there are form errors so that // optional form elements (e.g., captcha) can be updated in preview mode. - if ((variable_get('comment_preview', COMMENT_PREVIEW_REQUIRED) == COMMENT_PREVIEW_OPTIONAL) || ($op == t('Preview comment')) || ($op == t('Post comment'))) { + if (!form_get_errors() && ((variable_get('comment_preview', COMMENT_PREVIEW_REQUIRED) == COMMENT_PREVIEW_OPTIONAL) || ($op == t('Preview comment')) || ($op == t('Post comment')))) { $form['submit'] = array('#type' => 'submit', '#value' => t('Post comment'), '#weight' => 20); } diff --git a/modules/comment/comment.module b/modules/comment/comment.module index be7aab813b7..637e04e5b06 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -496,7 +496,6 @@ function comment_reply($nid, $pid = NULL) { } else if (user_access('access content')) { $output .= node_view($node); - $pid = 0; } // should we show the reply box? @@ -1350,7 +1349,7 @@ function comment_form($edit, $title = NULL) { // Only show post button if preview is optional or if we are in preview mode. // We show the post button in preview mode even if there are form errors so that // optional form elements (e.g., captcha) can be updated in preview mode. - if ((variable_get('comment_preview', COMMENT_PREVIEW_REQUIRED) == COMMENT_PREVIEW_OPTIONAL) || ($op == t('Preview comment')) || ($op == t('Post comment'))) { + if (!form_get_errors() && ((variable_get('comment_preview', COMMENT_PREVIEW_REQUIRED) == COMMENT_PREVIEW_OPTIONAL) || ($op == t('Preview comment')) || ($op == t('Post comment')))) { $form['submit'] = array('#type' => 'submit', '#value' => t('Post comment'), '#weight' => 20); }