回答:
以下のようjuampyが書いた、node_revisionは十分のように更新する必要があります。2つのクエリを実行する必要があります。
ステップ1:
UPDATE node SET comment = 0 WHERE type = 'your_content_type'ステップ2:
UPDATE node_revision nrev
INNER JOIN node nd ON nrev.nid = nd.nid AND nd.type = 'your_content_type'
SET nrev.comment = 0
ステップ3:キャッシュをクリアする
SQLを使用するのが最も簡単な場合があります。これはそのようなケースの1つだと思います。
UPDATE node SET comment = 0 WHERE type = 'nocommentsforthistype';0 =無効
1 =読み取り専用
2 =読み取り/書き込み。
uwe999で提案されているように、コンテンツタイプのデフォルトのコメント設定を変更すると、コンテンツタイプのデフォルト設定のみが変更されます。つまり、既存のコンテンツの設定をさかのぼって変更しません(既存のコメントが削除される可能性があるため)。
コメントを無効にし、そこで設定を更新しようとしている既存の各ノードのノード編集ビューにアクセスする必要があります。ノードの追加/編集ページから要素を非表示/削除するノードフォーム列モジュールのようなモジュールをインストールした場合、ノードのコメント設定ボックスが表示される構成を更新する必要があります。
上記の解決策はどれも私にとってはうまくいきませんでした。node_revisionも更新しない限り、コメントフォームは引き続き既存のノードに表示されます。
ここに私のために働いたhook_update_N()実装があります:
/**
 * Implements hook_update_N().
 *
 * Disables comments in existing event nodes.
 */
function hook_update_7000(&$sandbox) {
  $content_type = 'event';
  // Update node table.
  db_update('node')
    ->fields(array('comment' => 1))
    ->condition('type', $content_type)
   ->execute();
  // Update node_revision table.
  $nids = db_select('node', 'n')
    ->fields('n', array('nid'))
    ->condition('type', $content_type)
    ->execute()
    ->fetchCol();
  db_update('node_revision')
    ->fields(array('comment' => 1))
    ->condition('nid', $nids)
    ->execute();
}最初にここでコメントを無効にします。
structure->content types->{node_type}->edit->comment settings残念ながら、ノードを更新するには、各ノードを再保存する必要があります。以下のhook_updateを使用します。
/**
 * Disable comments on node_type
 */
function hook_update_N(&$sandbox) {
  $content_type = 'node_type';
  // Initialize batch.
  if (!isset($sandbox['total'])) {
    $query = db_select('node');
    $query->addExpression('COUNT(*)');
    $query->condition('type', $content_type);
    $sandbox['total'] = $query->execute()->fetchField();
    $sandbox['progress'] = 0;
    if (empty($sandbox['total'])) {
      $sandbox['#finished'] = 1;
      return t('No %type nodes exist in database.', array('%type' => $content_type));
    }
  }
  // Get and update nodes.
  $nids = db_select('node')
    ->fields('node', array('nid'))
    ->condition('type', $content_type)
    ->range(0, 10)
    ->execute()
    ->fetchCol();
  if (!empty($nids)) {
    $nodes = node_load_multiple($nids, NULL, TRUE);
    foreach ($nodes as $node) {
      $node->comment = 1; // I set comments as 1 where value of 2 enables the comments.
      node_save($node);   // Re-save the node.
    }
  }
  // Increment & check progress.
  $sandbox['progress'] += count($nids);
  if (empty($nids) || $sandbox['progress'] >= $sandbox['total']) {
    $sandbox['#finished'] = 1;
    return t('Updated @count nodes.', array('@count' => $sandbox['progress']));
  }
  else {
    $sandbox['#finished'] = $sandbox['progress'] / $sandbox['total'];
  }
}「node_type」をノードタイプに置き換えることを忘れないでください。
とても簡単です。以下の手順に従ってください。
ありがとう
UPDATE node SET comment = 0; UPDATE node_revision SET comment = 0です。私のために働いた:-)。