diff --git a/core/modules/forum/forum.install b/core/modules/forum/forum.install index 4bf6c2a..95fa531 100644 --- a/core/modules/forum/forum.install +++ b/core/modules/forum/forum.install @@ -112,7 +112,9 @@ function forum_enable() { $types = node_type_get_types(); node_add_body_field($types['forum']); // Add the comment field. - comment_add_default_comment_field('node', 'forum', 'comment_node_forum', COMMENT_OPEN); + if (!field_read_field('comment_node_forum', array('include_inactive' => TRUE))) { + comment_add_default_comment_field('node', 'forum', 'comment_node_forum', COMMENT_OPEN); + } } /** @@ -129,7 +131,6 @@ function forum_uninstall() { // Delete comment field, load comment in case it has been disabled. drupal_load('module', 'comment'); // Remove the forum comment field. - field_associate_fields('comment'); field_delete_field('comment_node_forum'); // Purge field data now to allow taxonomy and comment modules to be diff --git a/core/modules/forum/lib/Drupal/forum/Tests/Views/ForumIntegrationTest.php b/core/modules/forum/lib/Drupal/forum/Tests/Views/ForumIntegrationTest.php index cfcdfa2..482a44b 100644 --- a/core/modules/forum/lib/Drupal/forum/Tests/Views/ForumIntegrationTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/Views/ForumIntegrationTest.php @@ -65,9 +65,9 @@ public function testForumIntegration() { $comments = array(); foreach ($nodes as $index => $node) { for ($i = 0; $i <= $index; $i++) { - $comment = $comment_storage_controller->create(array('node_type' => 'node_type_forum', 'nid' => $node->id())); + $comment = $comment_storage_controller->create(array('entity_type' => 'node', 'entity_id' => $node->id(), 'field_name' => 'comment_node_forum')); $comment->save(); - $comments[$comment->get('nid')->target_id][$comment->id()] = $comment; + $comments[$comment->get('entity_id')->target_id][$comment->id()] = $comment; } }