1 comment.install comment_update_1003()

Node type comment settings should be closed instead of hidden by default.

Related topics

File

core/modules/comment/comment.install, line 397
Install, update and uninstall functions for the Comment module.

Code

function comment_update_1003() {
  foreach (config_get_names_with_prefix('node.type.') as $config_name) {
    $config = config($config_name);
    $comment_default = $config->get('settings.comment_default');
    if ($comment_default == COMMENT_NODE_HIDDEN) {
      $config->set('settings.comment_default', COMMENT_NODE_CLOSED);
      $config->save();
    }
  }
}