diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTest.php index da27687cf1..295e3623da 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTest.php @@ -21,6 +21,7 @@ class MigrateCommentTest extends MigrateDrupal7TestBase { 'comment', 'content_translation', 'datetime', + 'datetime_range', 'filter', 'image', 'language', diff --git a/core/modules/datetime/migrations/state/datetime.migrate_drupal.yml b/core/modules/datetime/migrations/state/datetime.migrate_drupal.yml index a4434b627e..6fa86cbe39 100644 --- a/core/modules/datetime/migrations/state/datetime.migrate_drupal.yml +++ b/core/modules/datetime/migrations/state/datetime.migrate_drupal.yml @@ -2,4 +2,4 @@ finished: 6: date: datetime 7: - date: datetime + date: datetime_range diff --git a/core/modules/datetime/src/Plugin/migrate/field/DateField.php b/core/modules/datetime/src/Plugin/migrate/field/DateField.php index 508aaa776f..e83b694942 100644 --- a/core/modules/datetime/src/Plugin/migrate/field/DateField.php +++ b/core/modules/datetime/src/Plugin/migrate/field/DateField.php @@ -5,8 +5,11 @@ use Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface; use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate\MigrateException; +use Drupal\migrate\Row; use Drupal\migrate_drupal\Plugin\migrate\field\FieldPluginBase; +// cspell:ignore todate + /** * Provides a field plugin for date and time fields. * @@ -92,6 +95,14 @@ public function defineValueProcessPipeline(MigrationInterface $migration, $field ], ]; + // If the 'todate' setting is specified the field is now a 'daterange' and + // so set the end value. If the datetime_range module is not enabled on the + // destination then end_value is ignored. + if (!empty($field_data['settings']['todate'])) { + $process['end_value'] = $process['value']; + $process['end_value']['source'] = 'value2'; + } + $process = [ 'plugin' => 'sub_process', 'source' => $field_name, @@ -100,4 +111,24 @@ public function defineValueProcessPipeline(MigrationInterface $migration, $field $migration->mergeProcessOfProperty($field_name, $process); } + /** + * {@inheritdoc} + */ + public function getFieldType(Row $row) { + $field_type = parent::getFieldType($row); + + // If the 'todate' setting is specified then change the field type to + // 'daterange' so we can migrate the end date. + if ($field_type === 'datetime' && !empty($row->get('settings/todate'))) { + if (\Drupal::service('module_handler')->moduleExists('datetime_range')) { + return 'daterange'; + } + else { + throw new MigrateException(sprintf("Can't migrate field '%s' with 'todate' settings. Enable the datetime_range module. See https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-drupal-6-or-7-to-drupal-8#datetime", $row->get('field_name'))); + } + } + + return $field_type; + } + } diff --git a/core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldTest.php b/core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldTest.php index 451c4657e9..17559666b7 100644 --- a/core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldTest.php +++ b/core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldTest.php @@ -6,6 +6,8 @@ use Drupal\migrate\MigrateException; use Drupal\Tests\UnitTestCase; +// cspell:ignore todate + /** * Provides unit tests for the DateField Plugin. * @@ -24,20 +26,35 @@ class DateFieldTest extends UnitTestCase { */ public function testDefineValueProcessPipeline($data, $from_format, $to_format) { $migration = $this->createMock('Drupal\migrate\Plugin\MigrationInterface'); + $pipeline = [ + 'plugin' => 'sub_process', + 'source' => 'field_date', + 'process' => [ + 'value' => [ + 'plugin' => 'format_date', + 'from_format' => $from_format, + 'to_format' => $to_format, + 'source' => 'value', + ], + ], + ]; + + // If there is a todate then add a process for the end value. + if (isset($data['field_definition']['data'])) { + $tmp = is_string($data['field_definition']['data']) ? unserialize($data['field_definition']['data']) : ''; + $todate = $tmp['settings']['todate'] ?? NULL; + if (!empty($todate)) { + $pipeline['process']['end_value'] = [ + 'plugin' => 'format_date', + 'from_format' => $from_format, + 'to_format' => $to_format, + 'source' => 'value2', + ]; + } + } $migration->expects($this->once()) ->method('mergeProcessOfProperty') - ->with('field_date', [ - 'plugin' => 'sub_process', - 'source' => 'field_date', - 'process' => [ - 'value' => [ - 'plugin' => 'format_date', - 'from_format' => $from_format, - 'to_format' => $to_format, - 'source' => 'value', - ], - ], - ]) + ->with('field_date', $pipeline) ->will($this->returnValue($migration)); $plugin = new DateField([], '', []); @@ -80,6 +97,7 @@ public function providerTestDefineValueProcessPipeline() { 0 => 'year', 1 => 'month', ], + 'todate' => '', ], ]), ], @@ -87,6 +105,25 @@ public function providerTestDefineValueProcessPipeline() { 'Y-m-d\TH:i:s', 'Y-m-d', ], + 'datetime with a todate' => [ + [ + 'type' => 'datetime', + 'field_definition' => [ + 'data' => serialize([ + 'settings' => [ + 'granularity' => [ + 'hour' => 0, + 'minute' => 0, + 'second' => 0, + ], + 'todate' => 'optional', + ], + ]), + ], + ], + 'Y-m-d H:i:s', + 'Y-m-d', + ], ]; } diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php index 3c6f1a8b82..162039c390 100644 --- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php +++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php @@ -16,6 +16,7 @@ class MigrateFieldFormatterSettingsTest extends MigrateDrupal7TestBase { protected static $modules = [ 'comment', 'datetime', + 'datetime_range', 'image', 'link', 'menu_ui', diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceLabelDescriptionTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceLabelDescriptionTest.php index 7720c1baa2..161f6cd946 100644 --- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceLabelDescriptionTest.php +++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceLabelDescriptionTest.php @@ -21,6 +21,7 @@ class MigrateFieldInstanceLabelDescriptionTest extends MigrateDrupal7TestBase im 'comment', 'config_translation', 'datetime', + 'datetime_range', 'field', 'file', 'image', diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php index 7e0372ceef..1155b3d97f 100644 --- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php +++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php @@ -19,6 +19,7 @@ class MigrateFieldInstanceTest extends MigrateDrupal7TestBase { protected static $modules = [ 'comment', 'datetime', + 'datetime_range', 'image', 'link', 'menu_ui', @@ -115,6 +116,7 @@ public function testFieldInstances() { $this->assertEntity('node.forum.taxonomy_forums', 'Forums', 'entity_reference', TRUE, FALSE); $this->assertEntity('comment.comment_forum.comment_body', 'Comment', 'text_long', TRUE, FALSE); $this->assertEntity('node.forum.body', 'Body', 'text_with_summary', FALSE, FALSE); + $this->assertEntity('node.forum.field_event', 'event', 'daterange', FALSE, FALSE); $this->assertEntity('comment.comment_node_test_content_type.comment_body', 'Comment', 'text_long', TRUE, FALSE); $this->assertEntity('node.test_content_type.field_boolean', 'Boolean', 'boolean', FALSE, FALSE); $this->assertEntity('node.test_content_type.field_email', 'Email', 'email', FALSE, FALSE); diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceWidgetSettingsTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceWidgetSettingsTest.php index da9a44f3fd..f04f1e5c02 100644 --- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceWidgetSettingsTest.php +++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceWidgetSettingsTest.php @@ -21,6 +21,7 @@ class MigrateFieldInstanceWidgetSettingsTest extends MigrateDrupal7TestBase { protected static $modules = [ 'comment', 'datetime', + 'datetime_range', 'image', 'link', 'menu_ui', diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldOptionTranslationTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldOptionTranslationTest.php index 08f258456d..b4d898f72e 100644 --- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldOptionTranslationTest.php +++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldOptionTranslationTest.php @@ -18,6 +18,7 @@ class MigrateFieldOptionTranslationTest extends MigrateDrupal7TestBase { 'comment', 'config_translation', 'datetime', + 'datetime_range', 'file', 'image', 'language', diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php index 1ad4c722cf..c7b1cead7a 100644 --- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php +++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php @@ -31,15 +31,6 @@ class MigrateFieldTest extends MigrateDrupal7TestBase { 'text', ]; - /** - * {@inheritdoc} - */ - protected function setUp(): void { - parent::setUp(); - $this->installConfig(static::$modules); - $this->executeMigration('d7_field'); - } - /** * Asserts various aspects of a field_storage_config entity. * @@ -53,7 +44,7 @@ protected function setUp(): void { * The expected cardinality of the field. */ protected function assertEntity($id, $expected_type, $expected_translatable, $expected_cardinality) { - list ($expected_entity_type, $expected_name) = explode('.', $id); + [$expected_entity_type, $expected_name] = explode('.', $id); /** @var \Drupal\field\FieldStorageConfigInterface $field */ $field = FieldStorageConfig::load($id); @@ -76,6 +67,10 @@ protected function assertEntity($id, $expected_type, $expected_translatable, $ex * Tests migrating D7 fields to field_storage_config entities. */ public function testFields() { + \Drupal::service('module_installer')->install(['datetime_range']); + $this->installConfig(static::$modules); + $this->executeMigration('d7_field'); + $this->assertEntity('node.body', 'text_with_summary', TRUE, 1); $this->assertEntity('node.field_long_text', 'text_with_summary', TRUE, 1); $this->assertEntity('comment.comment_body', 'text_long', TRUE, 1); @@ -151,6 +146,12 @@ public function testFields() { $field = FieldStorageConfig::load('node.field_user_reference'); $this->assertEquals('user', $field->getSetting('target_type')); + // Make sure a datetime field with a todate is now a daterange type. + $field = FieldStorageConfig::load('node.field_event'); + $this->assertSame('daterange', $field->getType()); + $this->assertSame('datetime_range', $field->getTypeProvider()); + $this->assertEquals('datetime', $field->getSetting('datetime_type')); + // Test the migration of text fields with different text processing. // All text and text_long field bases that have only plain text instances // should be migrated to string and string_long fields. @@ -188,4 +189,24 @@ public function testFields() { $this->assertEquals('Can\'t migrate source field field_text_sum_plain_filtered of type text_with_summary configured with plain text processing. See https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-drupal-6-or-7-to-drupal-8#plain-text', $errors[3]); } + /** + * Tests migrating D7 datetime fields. + */ + public function testDatetimeFields() { + $this->installConfig(static::$modules); + $this->executeMigration('d7_field'); + + // Datetime field with 'todate' settings is not migrated. + $this->assertNull(FieldStorageConfig::load('node.field_event')); + + // Check that we've reported on a conflict in widget_types. + // Validate that the source count and processed count match up. + /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */ + $migration = $this->getMigration('d7_field'); + $messages = iterator_to_array($migration->getIdMap()->getMessages()); + $this->assertCount(5, $messages); + $msg = "Can't migrate field 'field_event' with 'todate' settings. Enable the datetime_range module. See https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-drupal-6-or-7-to-drupal-8#datetime"; + $this->assertSame($messages[4]->message, $msg); + } + } diff --git a/core/modules/migrate_drupal/tests/fixtures/drupal7.php b/core/modules/migrate_drupal/tests/fixtures/drupal7.php index 2412555aaf..9c87164108 100644 --- a/core/modules/migrate_drupal/tests/fixtures/drupal7.php +++ b/core/modules/migrate_drupal/tests/fixtures/drupal7.php @@ -4632,7 +4632,22 @@ 'translatable' => '0', 'deleted' => '0', )) -->execute(); +->values(array( + 'id' => '62', + 'field_name' => 'field_event', + 'type' => 'datetime', + 'module' => 'date', + 'active' => '1', + 'storage_type' => 'field_sql_storage', + 'storage_module' => 'field_sql_storage', + 'storage_active' => '1', + 'locked' => '0', + 'data' => 'a:7:{s:12:"translatable";i:0;s:12:"entity_types";a:0:{}s:8:"settings";a:7:{s:11:"granularity";a:6:{s:5:"month";s:5:"month";s:3:"day";s:3:"day";s:4:"hour";s:4:"hour";s:6:"minute";s:6:"minute";s:4:"year";s:4:"year";s:6:"second";i:0;}s:11:"tz_handling";s:4:"site";s:11:"timezone_db";s:3:"UTC";s:13:"cache_enabled";i:0;s:11:"cache_count";s:1:"4";s:6:"todate";s:8:"optional";s:23:"entity_translation_sync";b:0;}s:7:"storage";a:5:{s:4:"type";s:17:"field_sql_storage";s:8:"settings";a:0:{}s:6:"module";s:17:"field_sql_storage";s:6:"active";s:1:"1";s:7:"details";a:1:{s:3:"sql";a:2:{s:18:"FIELD_LOAD_CURRENT";a:1:{s:22:"field_data_field_event";a:2:{s:5:"value";s:17:"field_event_value";s:6:"value2";s:18:"field_event_value2";}}s:19:"FIELD_LOAD_REVISION";a:1:{s:26:"field_revision_field_event";a:2:{s:5:"value";s:17:"field_event_value";s:6:"value2";s:18:"field_event_value2";}}}}}s:12:"foreign keys";a:0:{}s:7:"indexes";a:0:{}s:2:"id";s:2:"54";}', + 'cardinality' => '1', + 'translatable' => '0', + 'deleted' => '0', +)) + ->execute(); $connection->schema()->createTable('field_config_instance', array( 'fields' => array( 'id' => array( @@ -5500,6 +5515,15 @@ 'bundle' => 'article', 'data' => 'a:7:{s:5:"label";s:8:"checkbox";s:6:"widget";a:5:{s:6:"weight";s:2:"25";s:4:"type";s:15:"options_buttons";s:6:"module";s:7:"options";s:6:"active";i:1;s:8:"settings";a:0:{}}s:8:"settings";a:2:{s:18:"user_register_form";b:0;s:23:"entity_translation_sync";b:0;}s:7:"display";a:1:{s:7:"default";a:5:{s:5:"label";s:5:"above";s:4:"type";s:12:"list_default";s:8:"settings";a:0:{}s:6:"module";s:4:"list";s:6:"weight";i:25;}}s:8:"required";i:0;s:11:"description";s:0:"";s:13:"default_value";N;}', 'deleted' => '0', +)) + ->values(array( + 'id' => '94', + 'field_id' => '62', + 'field_name' => 'field_event', + 'entity_type' => 'node', + 'bundle' => 'forum', + 'data' => 'a:6:{s:5:"label";s:5:"event";s:6:"widget";a:5:{s:6:"weight";s:1:"2";s:4:"type";s:9:"date_text";s:6:"module";s:4:"date";s:6:"active";i:1;s:8:"settings";a:7:{s:12:"input_format";s:13:"m/d/Y - H:i:s";s:19:"input_format_custom";s:0:"";s:10:"year_range";s:5:"-3:+3";s:9:"increment";i:1;s:14:"label_position";s:5:"above";s:10:"text_parts";a:0:{}s:11:"no_fieldset";i:0;}}s:8:"settings";a:6:{s:13:"default_value";s:3:"now";s:18:"default_value_code";s:0:"";s:14:"default_value2";s:4:"same";s:19:"default_value_code2";s:0:"";s:18:"user_register_form";b:0;s:23:"entity_translation_sync";b:0;}s:7:"display";a:1:{s:7:"default";a:5:{s:5:"label";s:5:"above";s:4:"type";s:12:"date_default";s:8:"settings";a:6:{s:11:"format_type";s:4:"long";s:15:"multiple_number";s:0:"";s:13:"multiple_from";s:0:"";s:11:"multiple_to";s:0:"";s:6:"fromto";s:4:"both";s:19:"show_remaining_days";b:0;}s:6:"module";s:4:"date";s:6:"weight";i:12;}}s:8:"required";i:0;s:11:"description";s:0:"";}', + 'deleted' => '0', )) ->execute(); $connection->schema()->createTable('field_data_body', array( @@ -6805,6 +6829,121 @@ 'field_email_email' => 'another@example.com', )) ->execute(); +$connection->schema()->createTable('field_data_field_event', array( + 'fields' => array( + 'entity_type' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '128', + 'default' => '', + ), + 'bundle' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '128', + 'default' => '', + ), + 'deleted' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'tiny', + 'default' => '0', + ), + 'entity_id' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'unsigned' => TRUE, + ), + 'revision_id' => array( + 'type' => 'int', + 'not null' => FALSE, + 'size' => 'normal', + 'unsigned' => TRUE, + ), + 'language' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '32', + 'default' => '', + ), + 'delta' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'unsigned' => TRUE, + ), + 'field_event_value' => array( + 'type' => 'datetime', + 'not null' => FALSE, + 'mysql_type' => 'datetime', + 'pgsql_type' => 'timestamp without time zone', + 'sqlite_type' => 'varchar', + 'sqlsrv_type' => 'smalldatetime', + ), + 'field_event_value2' => array( + 'type' => 'datetime', + 'not null' => FALSE, + 'mysql_type' => 'datetime', + 'pgsql_type' => 'timestamp without time zone', + 'sqlite_type' => 'varchar', + 'sqlsrv_type' => 'smalldatetime', + ), + ), + 'primary key' => array( + 'entity_type', + 'entity_id', + 'deleted', + 'delta', + 'language', + ), + 'indexes' => array( + 'entity_type' => array( + 'entity_type', + ), + 'bundle' => array( + 'bundle', + ), + 'deleted' => array( + 'deleted', + ), + 'entity_id' => array( + 'entity_id', + ), + 'revision_id' => array( + 'revision_id', + ), + 'language' => array( + 'language', + ), + ), + 'mysql_character_set' => 'utf8', +)); + +$connection->insert('field_data_field_event') +->fields(array( + 'entity_type', + 'bundle', + 'deleted', + 'entity_id', + 'revision_id', + 'language', + 'delta', + 'field_event_value', + 'field_event_value2', +)) +->values(array( + 'entity_type' => 'node', + 'bundle' => 'forum', + 'deleted' => '0', + 'entity_id' => '7', + 'revision_id' => '7', + 'language' => 'und', + 'delta' => '0', + 'field_event_value' => '1993-01-04 02:00:00', + 'field_event_value2' => '1999-01-07 04:00:00', +)) +->execute(); $connection->schema()->createTable('field_data_field_file', array( 'fields' => array( 'entity_type' => array( @@ -13332,6 +13471,122 @@ 'field_email_email' => 'another@example.com', )) ->execute(); +$connection->schema()->createTable('field_revision_field_event', array( + 'fields' => array( + 'entity_type' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '128', + 'default' => '', + ), + 'bundle' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '128', + 'default' => '', + ), + 'deleted' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'tiny', + 'default' => '0', + ), + 'entity_id' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'unsigned' => TRUE, + ), + 'revision_id' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'unsigned' => TRUE, + ), + 'language' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '32', + 'default' => '', + ), + 'delta' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'unsigned' => TRUE, + ), + 'field_event_value' => array( + 'type' => 'datetime', + 'not null' => FALSE, + 'mysql_type' => 'datetime', + 'pgsql_type' => 'timestamp without time zone', + 'sqlite_type' => 'varchar', + 'sqlsrv_type' => 'smalldatetime', + ), + 'field_event_value2' => array( + 'type' => 'datetime', + 'not null' => FALSE, + 'mysql_type' => 'datetime', + 'pgsql_type' => 'timestamp without time zone', + 'sqlite_type' => 'varchar', + 'sqlsrv_type' => 'smalldatetime', + ), + ), + 'primary key' => array( + 'entity_type', + 'entity_id', + 'revision_id', + 'deleted', + 'delta', + 'language', + ), + 'indexes' => array( + 'entity_type' => array( + 'entity_type', + ), + 'bundle' => array( + 'bundle', + ), + 'deleted' => array( + 'deleted', + ), + 'entity_id' => array( + 'entity_id', + ), + 'revision_id' => array( + 'revision_id', + ), + 'language' => array( + 'language', + ), + ), + 'mysql_character_set' => 'utf8', +)); + +$connection->insert('field_revision_field_event') +->fields(array( + 'entity_type', + 'bundle', + 'deleted', + 'entity_id', + 'revision_id', + 'language', + 'delta', + 'field_event_value', + 'field_event_value2', +)) +->values(array( + 'entity_type' => 'node', + 'bundle' => 'forum', + 'deleted' => '0', + 'entity_id' => '7', + 'revision_id' => '7', + 'language' => 'und', + 'delta' => '0', + 'field_event_value' => '1993-01-04 02:00:00', + 'field_event_value2' => '1999-01-07 04:00:00', +)) +->execute(); $connection->schema()->createTable('field_revision_field_file', array( 'fields' => array( 'entity_type' => array( diff --git a/core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php b/core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php index 2bdf3a2b1c..8a86bbd938 100644 --- a/core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php +++ b/core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php @@ -28,6 +28,7 @@ class FieldDiscoveryTest extends MigrateDrupal7TestBase { protected static $modules = [ 'comment', 'datetime', + 'datetime_range', 'file', 'image', 'link', @@ -251,6 +252,11 @@ public function addAllFieldProcessesAltersData() { 'image_nodelink' => 'image', 'image_imagelink' => 'image', ], + 'datetime' => [ + 'date_default' => 'datetime_default', + 'format_interval' => 'datetime_time_ago', + 'date_plain' => 'datetime_plain', + ], 'email' => [ 'email_formatter_default' => 'email_mailto', 'email_formatter_contact' => 'basic_string', @@ -264,11 +270,6 @@ public function addAllFieldProcessesAltersData() { 'phone' => [ 'phone' => 'basic_string', ], - 'datetime' => [ - 'date_default' => 'datetime_default', - 'format_interval' => 'datetime_time_ago', - 'date_plain' => 'datetime_plain', - ], 'telephone' => [ 'text_plain' => 'string', 'telephone_link' => 'telephone_link', @@ -300,11 +301,11 @@ public function addAllFieldProcessesAltersData() { 'list' => 'list_default', 'file_mfw' => 'file_generic', 'filefield_widget' => 'file_generic', - 'email_textfield' => 'email_default', - 'phone' => 'phone_default', 'date' => 'datetime_default', 'datetime' => 'datetime_default', 'datestamp' => 'datetime_timestamp', + 'email_textfield' => 'email_default', + 'phone' => 'phone_default', ], ], ], diff --git a/core/modules/migrate_drupal/tests/src/Kernel/d7/FollowUpMigrationsTest.php b/core/modules/migrate_drupal/tests/src/Kernel/d7/FollowUpMigrationsTest.php index 94ef1d68f7..163c46e677 100644 --- a/core/modules/migrate_drupal/tests/src/Kernel/d7/FollowUpMigrationsTest.php +++ b/core/modules/migrate_drupal/tests/src/Kernel/d7/FollowUpMigrationsTest.php @@ -22,6 +22,7 @@ class FollowUpMigrationsTest extends MigrateDrupal7TestBase { 'content_translation', 'comment', 'datetime', + 'datetime_range', 'image', 'language', 'link', diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MultilingualReviewPageTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MultilingualReviewPageTest.php index 989f0963ee..0b3046f93c 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MultilingualReviewPageTest.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MultilingualReviewPageTest.php @@ -18,6 +18,7 @@ class MultilingualReviewPageTest extends MultilingualReviewPageTestBase { * {@inheritdoc} */ protected static $modules = [ + 'datetime_range', 'language', 'content_translation', 'config_translation', diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/NoMultilingualReviewPageTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/NoMultilingualReviewPageTest.php index b97373f5e3..b287008b90 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/NoMultilingualReviewPageTest.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/NoMultilingualReviewPageTest.php @@ -19,6 +19,7 @@ class NoMultilingualReviewPageTest extends NoMultilingualReviewPageTestBase { * {@inheritdoc} */ protected static $modules = [ + 'datetime_range', 'language', 'telephone', 'aggregator', diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php index 9a92f8b678..31feae3ccc 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php @@ -22,6 +22,7 @@ class Upgrade6Test extends MigrateUpgradeExecuteTestBase { 'book', 'config_translation', 'content_translation', + 'datetime_range', 'forum', 'language', 'migrate_drupal_ui', diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MultilingualReviewPageTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MultilingualReviewPageTest.php index 13df45943b..85fecfa0f6 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MultilingualReviewPageTest.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MultilingualReviewPageTest.php @@ -20,6 +20,7 @@ class MultilingualReviewPageTest extends MultilingualReviewPageTestBase { * {@inheritdoc} */ protected static $modules = [ + 'datetime_range', 'language', 'content_translation', 'telephone', diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/NoMultilingualReviewPageTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/NoMultilingualReviewPageTest.php index 35c0e3500e..ddc8dcd342 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/NoMultilingualReviewPageTest.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/NoMultilingualReviewPageTest.php @@ -23,6 +23,7 @@ class NoMultilingualReviewPageTest extends NoMultilingualReviewPageTestBase { 'book', 'config_translation', 'content_translation', + 'datetime_range', 'file', 'forum', 'language', diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/Upgrade7Test.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/Upgrade7Test.php index b05ef5d881..6b1d35e841 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/Upgrade7Test.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/Upgrade7Test.php @@ -25,6 +25,7 @@ class Upgrade7Test extends MigrateUpgradeExecuteTestBase { 'book', 'config_translation', 'content_translation', + 'datetime_range', 'forum', 'language', 'migrate_drupal_ui', @@ -84,8 +85,8 @@ protected function getEntityCounts() { 'contact_form' => 3, 'contact_message' => 0, 'editor' => 2, - 'field_config' => 90, - 'field_storage_config' => 69, + 'field_config' => 91, + 'field_storage_config' => 70, 'file' => 3, 'filter_format' => 7, 'image_style' => 7, diff --git a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeCompleteTest.php b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeCompleteTest.php index 1d366d3414..6aafa230f6 100644 --- a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeCompleteTest.php +++ b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeCompleteTest.php @@ -28,6 +28,7 @@ class MigrateNodeCompleteTest extends MigrateDrupal7TestBase { 'content_translation', 'comment', 'datetime', + 'datetime_range', 'image', 'language', 'link', diff --git a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeRevisionTest.php b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeRevisionTest.php index 1684e80e67..50cabf5f18 100644 --- a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeRevisionTest.php +++ b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeRevisionTest.php @@ -29,6 +29,7 @@ class MigrateNodeRevisionTest extends MigrateDrupal7TestBase { 'content_translation', 'comment', 'datetime', + 'datetime_range', 'file', 'filter', 'image', diff --git a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php index 919122f37e..0c62e6251d 100644 --- a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php +++ b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php @@ -25,6 +25,7 @@ class MigrateNodeTest extends MigrateDrupal7TestBase { 'content_translation', 'comment', 'datetime', + 'datetime_range', 'image', 'language', 'link', diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateNodeTaxonomyTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateNodeTaxonomyTest.php index a2a866ec16..651df9176b 100644 --- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateNodeTaxonomyTest.php +++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateNodeTaxonomyTest.php @@ -14,6 +14,7 @@ class MigrateNodeTaxonomyTest extends MigrateDrupal7TestBase { protected static $modules = [ 'comment', 'datetime', + 'datetime_range', 'image', 'link', 'menu_ui', diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php index ab2afce6e1..e9f7f89f8f 100644 --- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php +++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php @@ -17,6 +17,7 @@ class MigrateTaxonomyTermTest extends MigrateDrupal7TestBase { 'comment', 'content_translation', 'datetime', + 'datetime_range', 'image', 'language', 'link', diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTranslationTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTranslationTest.php index 89390302a4..c85a52f6d1 100644 --- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTranslationTest.php +++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTranslationTest.php @@ -20,6 +20,7 @@ class MigrateTaxonomyTermTranslationTest extends MigrateDrupal7TestBase { 'comment', 'content_translation', 'datetime', + 'datetime_range', 'image', 'language', 'link', diff --git a/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserTest.php b/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserTest.php index 8f40bea87c..655b460f47 100644 --- a/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserTest.php +++ b/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserTest.php @@ -22,6 +22,7 @@ class MigrateUserTest extends MigrateDrupal7TestBase { 'comment', 'content_translation', 'datetime', + 'datetime_range', 'image', 'language', 'link',