function flatcomments_comment_form_submit in Flatcomments 6
Same name and namespace in other branches
- 6.2 flatcomments.module \flatcomments_comment_form_submit()
Sets comment pid to null prior to comment save.
See also
1 string reference to 'flatcomments_comment_form_submit'
- flatcomments_form_alter in ./
flatcomments.module - Implementation of hook_form_alter().
File
- ./
flatcomments.module, line 54 - Make comments replies to the node, regardless of the reply link used.
Code
function flatcomments_comment_form_submit($form, &$form_state) {
$node = node_load($form_state['values']['nid']);
$display_mode = (int) variable_get('comment_default_mode_' . $node->type, 0);
$orderable = (int) variable_get('flatcomments_default_mode_' . $node->type, 0);
// Only alter new comments.
if ((in_array($display_mode, array(
1,
2,
)) || $orderable === 5) && !$form_state['values']['cid']) {
// Setting pid to NULL makes the comment a reply to the node.
$form_state['values']['pid'] = NULL;
}
}