summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/comment.module3
-rw-r--r--modules/comment/comment.module3
2 files changed, 2 insertions, 4 deletions
diff --git a/modules/comment.module b/modules/comment.module
index be7aab813..637e04e5b 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 be7aab813..637e04e5b 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);
}