diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_profile_field.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_profile_field.yml index 14103025de6c922439de7b78bd73a4638709bbed..eba5cb352dcd68e9d8456c9bce1fa8dcd9d0eac4 100644 --- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_profile_field.yml +++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_profile_field.yml @@ -18,6 +18,9 @@ process: textfield: text textarea: text_long url: link + settings: + plugin: d6_profile_field_settings + source: type settings.allowed_values: options cardinality: plugin: static_map diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/ProfileFieldSettings.php b/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/ProfileFieldSettings.php new file mode 100644 index 0000000000000000000000000000000000000000..2ce2050e4d4df638ff623ee45150184997200b63 --- /dev/null +++ b/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/ProfileFieldSettings.php @@ -0,0 +1,36 @@ +<?php + +/** + * @file + * Contains \Drupal\migrate_drupal\Plugin\migrate\Process\d6\ProfileFieldSettings. + */ + +namespace Drupal\migrate_drupal\Plugin\migrate\Process\d6; + +use Drupal\migrate\MigrateExecutable; +use Drupal\migrate\ProcessPluginBase; +use Drupal\migrate\Row; + +/** + * @MigrateProcessPlugin( + * id = "d6_profile_field_settings" + * ) + */ +class ProfileFieldSettings extends ProcessPluginBase { + + /** + * {@inheritdoc} + * + * Set the profile field settings configuration. + */ + public function transform($type, MigrateExecutable $migrate_executable, Row $row, $destination_property) { + $settings = array(); + switch ($type) { + case 'date': + $settings['datetime_type'] = 'date'; + break; + } + return $settings; + } + +} diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php index 71a1bcf99f5f188548346187cbb559d5ed947074..f41b91f0f37d45ecb35b7ab5ce1954fd31faa526 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php @@ -86,6 +86,7 @@ public function testUserProfileFields() { // Migrated date field. $field = entity_load('field_config', 'user.profile_birthdate'); $this->assertEqual($field->type, 'datetime', 'Field type is datetime.'); + $this->assertEqual($field->settings['datetime_type'], 'date'); } }