summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-07-24 17:48:16 +0000
committerDries Buytaert <dries@buytaert.net>2010-07-24 17:48:16 +0000
commita45b6488f033ef5522e066366a66154c8cc5c031 (patch)
tree4113075959c28b5f0d2f49a062c999f9bde66179 /modules
parenta6f7939484cb29e67731deaa776133060b5eda5d (diff)
downloadbrdo-a45b6488f033ef5522e066366a66154c8cc5c031.tar.gz
brdo-a45b6488f033ef5522e066366a66154c8cc5c031.tar.bz2
- Patch #643656 by sun: comment 'Save' button disappears on form validation error.
Diffstat (limited to 'modules')
-rw-r--r--modules/comment/comment.module6
1 files changed, 2 insertions, 4 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 8b1041a5e..a2b73e6c1 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -1944,14 +1944,12 @@ function comment_form($form, &$form_state, $comment) {
$form['node_type'] = array('#type' => 'value', '#value' => 'comment_node_' . $node->type);
// 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.
+ // already previewing the submission.
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
- '#access' => ($comment->cid && user_access('administer comments')) || variable_get('comment_preview_' . $node->type, DRUPAL_OPTIONAL) != DRUPAL_REQUIRED || (!form_get_errors() && isset($form_state['comment_preview'])),
+ '#access' => ($comment->cid && user_access('administer comments')) || variable_get('comment_preview_' . $node->type, DRUPAL_OPTIONAL) != DRUPAL_REQUIRED || isset($form_state['comment_preview']),
'#weight' => 19,
);
$form['actions']['preview'] = array(