diff --git a/core/modules/field/migration_templates/d6_field.yml b/core/modules/field/migration_templates/d6_field.yml index 11b185f..c70f375 100644 --- a/core/modules/field/migration_templates/d6_field.yml +++ b/core/modules/field/migration_templates/d6_field.yml @@ -17,7 +17,8 @@ process: field_name: field_name type: - - plugin: d6_field_type + plugin: field_type + core: 6 source: - type - widget_type diff --git a/core/modules/field/migration_templates/d7_field.yml b/core/modules/field/migration_templates/d7_field.yml index 5346a6d..01fc527 100755 --- a/core/modules/field/migration_templates/d7_field.yml +++ b/core/modules/field/migration_templates/d7_field.yml @@ -13,7 +13,8 @@ process: langcode: 'constants/langcode' field_name: field_name type: - plugin: d7_field_type + plugin: field_type + core: 7 source: type map: date: datetime diff --git a/core/modules/field/src/Plugin/migrate/process/FieldType.php b/core/modules/field/src/Plugin/migrate/process/FieldType.php new file mode 100644 index 0000000..a399c64 --- /dev/null +++ b/core/modules/field/src/Plugin/migrate/process/FieldType.php @@ -0,0 +1,75 @@ +cckPluginManager = $cck_plugin_manager; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + return new static( + $configuration, + $plugin_id, + $plugin_definition, + $container->get('plugin.manager.migrate.cckfield') + ); + } + + /** + * {@inheritdoc} + */ + public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { + list ($field_type, $widget_type) = $value; + + try { + return $this->cckPluginManager->createInstance($field_type, ['core' => $this->configuration['core']])->getFieldType($row); + } + catch (PluginNotFoundException $e) { + return parent::transform($value, $migrate_executable, $row, $destination_property); + } + } + +} diff --git a/core/modules/field/src/Plugin/migrate/process/d6/FieldType.php b/core/modules/field/src/Plugin/migrate/process/d6/FieldType.php deleted file mode 100644 index 22b5173..0000000 --- a/core/modules/field/src/Plugin/migrate/process/d6/FieldType.php +++ /dev/null @@ -1,75 +0,0 @@ -cckPluginManager = $cck_plugin_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('plugin.manager.migrate.cckfield') - ); - } - - /** - * {@inheritdoc} - */ - public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { - list ($field_type, $widget_type) = $value; - - try { - return $this->cckPluginManager->createInstance($field_type, ['core' => 6])->getFieldType($row); - } - catch (PluginNotFoundException $e) { - return parent::transform($value, $migrate_executable, $row, $destination_property); - } - } - -} diff --git a/core/modules/field/src/Plugin/migrate/process/d7/FieldType.php b/core/modules/field/src/Plugin/migrate/process/d7/FieldType.php deleted file mode 100644 index c075b70..0000000 --- a/core/modules/field/src/Plugin/migrate/process/d7/FieldType.php +++ /dev/null @@ -1,73 +0,0 @@ -cckPluginManager = $cck_plugin_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('plugin.manager.migrate.cckfield') - ); - } - - /** - * {@inheritdoc} - */ - public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { - try { - return $this->cckPluginManager->createInstance($value, ['core' => 7])->getFieldType($row); - } - catch (PluginNotFoundException $e) { - return parent::transform($value, $migrate_executable, $row, $destination_property); - } - } - -}