From 928822d0a9fc3ceb520d13ac2481a7030a9b283f Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Fri, 20 Jun 2008 16:52:55 +0000
Subject: [PATCH] - Patch #272054 by David Rothstein: fixed code comment for
 comment_form().

---
 modules/comment/comment.module | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 26a03ca2837f..67861b07847a 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -1410,9 +1410,10 @@ function comment_form(&$form_state, $edit, $title = NULL) {
     '#value' => !empty($edit['uid']) ? $edit['uid'] : NULL,
   );
 
-  // Only show save button if preview is optional or if we are in preview mode.
-  // We show the save button in preview mode even if there are form errors so that
-  // optional form elements (e.g., captcha) can be updated in preview mode.
+  // Only show the save button if comment previews are optional or if we are
+  // already previewing the submission.  However, if there are form errors,
+  // we hide the save button no matter what, so that optional form elements
+  // (e.g., captchas) can be updated.
   if (!form_get_errors() && ((variable_get('comment_preview_' . $node->type, COMMENT_PREVIEW_REQUIRED) == COMMENT_PREVIEW_OPTIONAL) || ($op == t('Preview')) || ($op == t('Save')))) {
     $form['submit'] = array(
       '#type' => 'submit',
-- 
GitLab