diff -u b/core/modules/datetime/src/Plugin/migrate/cckfield/d6/DateField.php b/core/modules/datetime/src/Plugin/migrate/cckfield/d6/DateField.php --- b/core/modules/datetime/src/Plugin/migrate/cckfield/d6/DateField.php +++ b/core/modules/datetime/src/Plugin/migrate/cckfield/d6/DateField.php @@ -3,6 +3,7 @@ namespace Drupal\datetime\Plugin\migrate\cckfield\d6; use Drupal\migrate\Plugin\MigrationInterface; +use Drupal\migrate\Row; use Drupal\migrate_drupal\Plugin\migrate\cckfield\CckFieldPluginBase; /** @@ -10,7 +11,7 @@ * id = "date", * type_map = { * "date" = "datetime", - * "datestamp" = "datetime", + * "datestamp" = "timestamp", * "datetime" = "datetime", * }, * core = {6} @@ -44,12 +45,19 @@ break; } $process = [ - 'plugin' => 'format_date', - 'from_format' => $from_format, - 'to_format' => 'Y-m-d\TH:i:s', - 'source' => $field_name, + 'value' => [ + 'plugin' => 'format_date', + 'from_format' => $from_format, + 'to_format' => 'Y-m-d\TH:i:s', + 'source' => 'value', + ], ]; + $process = [ + 'plugin' => 'iterator', + 'source' => $field_name, + 'process' => $process, + ]; $migration->mergeProcessOfProperty($field_name, $process); } diff -u b/core/modules/field/migration_templates/d6_field.yml b/core/modules/field/migration_templates/d6_field.yml --- b/core/modules/field/migration_templates/d6_field.yml +++ b/core/modules/field/migration_templates/d6_field.yml @@ -40,18 +40,6 @@ filefield: imagefield_widget: image filefield_widget: file - date: - date_select: datetime - date_text: datetime - date_popup: datetime - datestamp: - date_select: datetime - date_text: datetime - date_popup: datetime - datetime: - date_select: datetime - date_text: datetime - date_popup: datetime fr_phone: phone_textfield: telephone be_phone: diff -u b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldTest.php b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldTest.php --- b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldTest.php +++ b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldTest.php @@ -66,7 +66,7 @@ $field_storage = FieldStorageConfig::load('node.field_test_datetime'); $this->assertSame("datetime", $field_storage->getType(), t('Field type is @fieldtype. It should be datetime.', array('@fieldtype' => $field_storage->getType()))); $field_storage = FieldStorageConfig::load('node.field_test_datestamp'); - $this->assertSame("datetime", $field_storage->getType(), t('Field type is @fieldtype. It should be datetime.', array('@fieldtype' => $field_storage->getType()))); + $this->assertSame("timestamp", $field_storage->getType(), t('Field type is @fieldtype. It should be timestamp.', array('@fieldtype' => $field_storage->getType()))); $field_storage = FieldStorageConfig::load('node.field_test_date'); $this->assertSame("datetime", $field_storage->getType(), t('Field type is @fieldtype. It should be datetime.', array('@fieldtype' => $field_storage->getType()))); diff -u b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php --- b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php +++ b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php @@ -72,9 +72,10 @@ $this->assertIdentical('1', $node->field_test_identical2->value, 'Integer value is correct'); $this->assertIdentical('This is a field with exclude unset.', $node->field_test_exclude_unset->value, 'Field with exclude unset is correct.'); - $this->assertSame('2013-01-02T04:05:00', $node->field_test_date->value, 'Date field with text widget is correct'); - $this->assertSame('2014-02-02T16:06:00', $node->field_test_datestamp->value, 'Date field with text widget is correct'); - $this->assertSame('2015-03-04T06:07:00', $node->field_test_datetime->value, 'Date field with text widget is correct'); + // Test that date fields are migrated. + $this->assertSame('2013-01-02T04:05:00', $node->field_test_date->value, 'Date field is correct'); + $this->assertSame('2014-02-02T16:06:00', $node->field_test_datestamp->value, 'Datestamp field is correct'); + $this->assertSame('2015-03-04T06:07:00', $node->field_test_datetime->value, 'Datetime field is correct'); // Test that link fields are migrated. $this->assertIdentical('https://www.drupal.org/project/drupal', $node->field_test_link->uri);