Issue #1181750 by Everett Zufelt, sun: Fixed Removal of 'Hidden' option in comment settings form may break programmatic form submissions.

8.0.x
Nathaniel 2012-01-10 12:06:42 +09:00
parent c9e40d59dc
commit 81b0109835
1 changed files with 2 additions and 2 deletions

View File

@ -1233,8 +1233,8 @@ function comment_form_node_form_alter(&$form, $form_state) {
// If the node doesn't have any comments, the "hidden" option makes no
// sense, so don't even bother presenting it to the user.
if (empty($comment_count)) {
unset($form['comment_settings']['comment']['#options'][COMMENT_NODE_HIDDEN]);
unset($form['comment_settings']['comment'][COMMENT_NODE_HIDDEN]);
$form['comment_settings']['comment'][COMMENT_NODE_HIDDEN]['#access'] = FALSE;
// Also adjust the description of the "closed" option.
$form['comment_settings']['comment'][COMMENT_NODE_CLOSED]['#description'] = t('Users cannot post comments.');
}
}