diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityCommentType.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityCommentType.php new file mode 100644 index 0000000..79be04b --- /dev/null +++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityCommentType.php @@ -0,0 +1,28 @@ +addBodyField(reset($entity_ids)); + return $entity_ids; + } + +} diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTest.php index 8206618..74ff074 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTest.php @@ -28,16 +28,13 @@ protected function setUp() { parent::setUp(); entity_create('node_type', array('type' => 'page'))->save(); entity_create('node_type', array('type' => 'story'))->save(); - $this->container->get('entity.manager')->getStorage('comment_type')->create(array( - 'id' => 'comment', - 'label' => 'comment', - 'target_entity_type_id' => 'node', - ))->save(); + \Drupal::service('comment.manager')->addDefaultField('node', 'story'); $this->container->get('entity.manager')->getStorage('comment_type')->create(array( 'id' => 'comment_no_subject', 'label' => 'comment_no_subject', 'target_entity_type_id' => 'node', ))->save(); + \Drupal::service('comment.manager')->addBodyField('comment_no_subject'); $node = entity_create('node', array( 'type' => 'story', @@ -55,7 +52,6 @@ protected function setUp() { ); $this->prepareMigrations($id_mappings); - \Drupal::service('comment.manager')->addDefaultField('node', 'story'); /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', 'd6_comment');