- Modified patch #46227 by chx: comment token is broken.

4.7.x
Dries Buytaert 2006-01-31 15:26:39 +00:00
parent 4ffb77baae
commit a6dac9d2ab
2 changed files with 2 additions and 4 deletions

View File

@ -496,7 +496,6 @@ function comment_reply($nid, $pid = NULL) {
} }
else if (user_access('access content')) { else if (user_access('access content')) {
$output .= node_view($node); $output .= node_view($node);
$pid = 0;
} }
// should we show the reply box? // 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. // 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 // 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. // 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); $form['submit'] = array('#type' => 'submit', '#value' => t('Post comment'), '#weight' => 20);
} }

View File

@ -496,7 +496,6 @@ function comment_reply($nid, $pid = NULL) {
} }
else if (user_access('access content')) { else if (user_access('access content')) {
$output .= node_view($node); $output .= node_view($node);
$pid = 0;
} }
// should we show the reply box? // 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. // 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 // 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. // 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); $form['submit'] = array('#type' => 'submit', '#value' => t('Post comment'), '#weight' => 20);
} }