From a8737c296c129776305896f8a6f5f5f204532e60 Mon Sep 17 00:00:00 2001 From: webchick Date: Sat, 21 Jan 2012 09:19:11 -0800 Subject: Issue #1181750 by Everett Zufelt, sun: Fixed Removal of 'Hidden' option in comment settings form may break programmatic form submissions. --- modules/comment/comment.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 239cd5bec..3ec441075 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1232,8 +1232,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.'); } } -- cgit v1.2.3