1 comment.module comment_node_presave(Node $node)

Implements hook_node_presave().

File

core/modules/comment/comment.module, line 1275
Enables users to comment on published content.

Code

function comment_node_presave(Node $node) {
  if ($node->comment == COMMENT_NODE_CLOSED && property_exists($node, 'comment_hidden') && $node->comment_hidden) {
    $node->comment = COMMENT_NODE_HIDDEN;
    unset($node->comment_hidden);
  }
  // As in comment_form_node_form_alter(), an unchecked value means the comment
  // override should be enabled.
  if (isset($node->comment_close_enabled)) {
    $node->comment_close_override = !$node->comment_close_enabled;
    unset($node->comment_close_enabled);
  }
}