commit a8a8dbe7453bc55310e71578d0407706329aec8e Author: Lee Rowlands Date: Sun May 25 11:25:28 2014 +1000 Patch 60 diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index e878dfd..61d94bf 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -221,16 +221,6 @@ function comment_field_instance_config_update(FieldInstanceConfigInterface $inst } /** - * Implements hook_ENTITY_TYPE_delete() for 'field_config'. - */ -function comment_field_config_delete(FieldConfigInterface $field) { - if ($field->getType() == 'comment') { - // Delete all fields and displays attached to the comment bundle. - entity_invoke_bundle_hook('delete', 'comment', $field->entity_type . '__' . $field->getName()); - } -} - -/** * Implements hook_ENTITY_TYPE_delete() for 'field_instance_config'. */ function comment_field_instance_config_delete(FieldInstanceConfigInterface $instance) { diff --git a/core/modules/comment/lib/Drupal/comment/Entity/CommentType.php b/core/modules/comment/lib/Drupal/comment/Entity/CommentType.php index 600e78c..eaf8232 100644 --- a/core/modules/comment/lib/Drupal/comment/Entity/CommentType.php +++ b/core/modules/comment/lib/Drupal/comment/Entity/CommentType.php @@ -92,4 +92,14 @@ public function getTargetEntityTypeId() { return $this->targetEntityTypeId; } + /** + * {@inheritdoc} + */ + public function postSave(EntityStorageInterface $storage, $update = TRUE) { + parent::postSave($storage, $update); + if (!$update && !$this->isSyncing()) { + \Drupal::service('comment.manager')->addBodyField($this->id()); + } + } + } diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_comment.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_comment.yml index 9575570..34e681e 100644 --- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_comment.yml +++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_comment.yml @@ -46,6 +46,8 @@ process: destination: plugin: entity:comment migration_dependencies: + optional: + - d6_comment_type required: - d6_node - d6_user