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 401
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 hidden (COMMENT_NODE_HIDDEN).
    if ($comment_default == 0) {
      $config->set('settings.comment_default', 1); // COMMENT_NODE_CLOSED
      $config->save();
    }
  }
}