From 09ad5fdb76452510bcaca4ab1bc231ffaf72db73 Mon Sep 17 00:00:00 2001 From: Nathaniel Catchpole Date: Wed, 23 Nov 2016 14:23:45 +0000 Subject: [PATCH] Issue #2543568 by mikeryan, quietone, Ryan Weal, chipway, iMiksu, heddn, alexpott: Remove the md_entity destination plugin hack --- .../comment/migration_templates/d6_comment_field.yml | 5 ++++- core/modules/field/migration_templates/d6_field.yml | 2 +- core/modules/file/migration_templates/d6_upload_field.yml | 5 ++++- .../migrate/src/Plugin/MigrateDestinationInterface.php | 5 +---- .../migrate/destination/EntityFieldStorageConfig.php | 8 +++++++- .../taxonomy/migration_templates/d6_vocabulary_field.yml | 5 ++++- .../user/migration_templates/user_picture_field.yml | 5 ++++- .../user/migration_templates/user_profile_field.yml | 2 +- 8 files changed, 26 insertions(+), 11 deletions(-) diff --git a/core/modules/comment/migration_templates/d6_comment_field.yml b/core/modules/comment/migration_templates/d6_comment_field.yml index 469d604d072..d14d1aa4fc1 100644 --- a/core/modules/comment/migration_templates/d6_comment_field.yml +++ b/core/modules/comment/migration_templates/d6_comment_field.yml @@ -13,7 +13,10 @@ process: type: 'constants/type' 'settings/comment_type': comment_type destination: - plugin: md_entity:field_storage_config + plugin: entity:field_storage_config + dependencies: + module: + - comment migration_dependencies: required: - d6_comment_type diff --git a/core/modules/field/migration_templates/d6_field.yml b/core/modules/field/migration_templates/d6_field.yml index 3157808f569..1205b67efac 100644 --- a/core/modules/field/migration_templates/d6_field.yml +++ b/core/modules/field/migration_templates/d6_field.yml @@ -123,4 +123,4 @@ process: - '@type' - global_settings destination: - plugin: md_entity:field_storage_config + plugin: entity:field_storage_config diff --git a/core/modules/file/migration_templates/d6_upload_field.yml b/core/modules/file/migration_templates/d6_upload_field.yml index c0b4569a699..a919f918ff5 100644 --- a/core/modules/file/migration_templates/d6_upload_field.yml +++ b/core/modules/file/migration_templates/d6_upload_field.yml @@ -20,4 +20,7 @@ process: cardinality: 'constants/cardinality' 'settings/display_field': 'constants/display_field' destination: - plugin: md_entity:field_storage_config + plugin: entity:field_storage_config + dependencies: + module: + - file diff --git a/core/modules/migrate/src/Plugin/MigrateDestinationInterface.php b/core/modules/migrate/src/Plugin/MigrateDestinationInterface.php index b6e86a09f85..9c83baf295c 100644 --- a/core/modules/migrate/src/Plugin/MigrateDestinationInterface.php +++ b/core/modules/migrate/src/Plugin/MigrateDestinationInterface.php @@ -83,11 +83,8 @@ interface MigrateDestinationInterface extends PluginInspectionInterface { * Derived classes must implement fields(), returning a list of available * destination fields. * - * @todo Review the cases where we need the Migration parameter, can we avoid - * that? To be resolved with https://www.drupal.org/node/2543568. - * * @param \Drupal\migrate\Plugin\MigrationInterface $migration - * (optional) The migration containing this destination. Defaults to NULL. + * Unused, will be removed before Drupal 9.0.x. Defaults to NULL. * * @return array * - Keys: machine names of the fields diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/destination/EntityFieldStorageConfig.php b/core/modules/migrate_drupal/src/Plugin/migrate/destination/EntityFieldStorageConfig.php index cc8431de386..169390a6a84 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/destination/EntityFieldStorageConfig.php +++ b/core/modules/migrate_drupal/src/Plugin/migrate/destination/EntityFieldStorageConfig.php @@ -9,11 +9,17 @@ use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate\Plugin\migrate\destination\EntityFieldStorageConfig as BaseEntityFieldStorageConfig; /** - * Destination with Drupal specific config dependencies. + * Deprecated. Destination with Drupal specific config dependencies. * * @MigrateDestination( * id = "md_entity:field_storage_config" * ) + * + * @deprecated in Drupal 8.2.x and will be removed in Drupal 9.0.x. Use + * \Drupal\migrate\Plugin\migrate\destination\EntityFieldStorageConfig + * instead. + * + * @see \Drupal\migrate\Plugin\migrate\destination\EntityFieldStorageConfig */ class EntityFieldStorageConfig extends BaseEntityFieldStorageConfig { diff --git a/core/modules/taxonomy/migration_templates/d6_vocabulary_field.yml b/core/modules/taxonomy/migration_templates/d6_vocabulary_field.yml index a1c97356f04..0e1a4872880 100644 --- a/core/modules/taxonomy/migration_templates/d6_vocabulary_field.yml +++ b/core/modules/taxonomy/migration_templates/d6_vocabulary_field.yml @@ -22,7 +22,10 @@ process: 'settings/target_type': 'constants/target_entity_type' cardinality: cardinality destination: - plugin: md_entity:field_storage_config + plugin: entity:field_storage_config + dependencies: + module: + - entity_reference migration_dependencies: required: - d6_taxonomy_vocabulary diff --git a/core/modules/user/migration_templates/user_picture_field.yml b/core/modules/user/migration_templates/user_picture_field.yml index a484ab8d1cf..ff8bd827494 100644 --- a/core/modules/user/migration_templates/user_picture_field.yml +++ b/core/modules/user/migration_templates/user_picture_field.yml @@ -18,4 +18,7 @@ process: type: 'constants/type' cardinality: 'constants/cardinality' destination: - plugin: md_entity:field_storage_config + plugin: entity:field_storage_config + dependencies: + module: + - image diff --git a/core/modules/user/migration_templates/user_profile_field.yml b/core/modules/user/migration_templates/user_profile_field.yml index bf81898220f..3ba0eee48cc 100644 --- a/core/modules/user/migration_templates/user_profile_field.yml +++ b/core/modules/user/migration_templates/user_profile_field.yml @@ -32,4 +32,4 @@ process: map: list: -1 destination: - plugin: md_entity:field_storage_config + plugin: entity:field_storage_config