Revert "Issue #2894068 by Jo Fitzgerald, davidsickmiller, Yogesh Pawar, heddn, quietone: datetime_type is not set correctly when migrating datetime fields from D7"
This reverts commit a151cef151
.
8.5.x
parent
ee0f806896
commit
a22c5d30d6
|
@ -26,16 +26,6 @@ class FieldSettings extends ProcessPluginBase {
|
|||
}
|
||||
break;
|
||||
|
||||
case 'date':
|
||||
case 'datetime':
|
||||
case 'datestamp':
|
||||
if ($value['granularity']['hour'] === 0
|
||||
&& $value['granularity']['minute'] === 0
|
||||
&& $value['granularity']['second'] === 0) {
|
||||
$value['datetime_type'] = 'date';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'taxonomy_term_reference':
|
||||
$value['target_type'] = 'taxonomy_term';
|
||||
break;
|
||||
|
|
|
@ -101,8 +101,6 @@ class MigrateFieldTest extends MigrateDrupal7TestBase {
|
|||
$this->assertEntity('node.field_node_entityreference', 'entity_reference', TRUE, -1);
|
||||
$this->assertEntity('node.field_user_entityreference', 'entity_reference', TRUE, 1);
|
||||
$this->assertEntity('node.field_term_entityreference', 'entity_reference', TRUE, -1);
|
||||
$this->assertEntity('node.field_date_without_time', 'datetime', TRUE, 1);
|
||||
$this->assertEntity('node.field_datetime_without_time', 'datetime', TRUE, 1);
|
||||
|
||||
// Assert that the taxonomy term reference fields are referencing the
|
||||
// correct entity type.
|
||||
|
@ -119,18 +117,6 @@ class MigrateFieldTest extends MigrateDrupal7TestBase {
|
|||
$this->assertEquals('user', $field->getSetting('target_type'));
|
||||
$field = FieldStorageConfig::load('node.field_term_entityreference');
|
||||
$this->assertEquals('taxonomy_term', $field->getSetting('target_type'));
|
||||
|
||||
// Make sure that datetime fields get the right datetime_type setting
|
||||
$field = FieldStorageConfig::load('node.field_date');
|
||||
$this->assertEquals('datetime', $field->getSetting('datetime_type'));
|
||||
$field = FieldStorageConfig::load('node.field_date_without_time');
|
||||
$this->assertEquals('date', $field->getSetting('datetime_type'));
|
||||
$field = FieldStorageConfig::load('node.field_datetime_without_time');
|
||||
$this->assertEquals('date', $field->getSetting('datetime_type'));
|
||||
// Except for field_date_with_end_time which is a timestamp and so does not
|
||||
// have a datetime_type setting.
|
||||
$field = FieldStorageConfig::load('node.field_date_with_end_time');
|
||||
$this->assertNull($field->getSetting('datetime_type'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -3576,36 +3576,6 @@ $connection->insert('field_config')
|
|||
'translatable' => '0',
|
||||
'deleted' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'id' => '35',
|
||||
'field_name' => 'field_datetime_without_time',
|
||||
'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";s:1:"0";s:12:"entity_types";a:0:{}s:8:"settings";a:6:{s:11:"granularity";a:6:{s:5:"month";s:5:"month";s:3:"day";s:3:"day";s:4:"hour";i:0;s:6:"minute";i:0;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: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:38:"field_data_field_datetime_without_time";a:1:{s:5:"value";s:33:"field_datetime_without_time_value";}}s:19:"FIELD_LOAD_REVISION";a:1:{s:42:"field_revision_field_datetime_without_time";a:1:{s:5:"value";s:33:"field_datetime_without_time_value";}}}}}s:12:"foreign keys";a:0:{}s:7:"indexes";a:0:{}s:2:"id";s:1:"9";}',
|
||||
'cardinality' => '1',
|
||||
'translatable' => '0',
|
||||
'deleted' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'id' => '36',
|
||||
'field_name' => 'field_date_without_time',
|
||||
'type' => 'date',
|
||||
'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";s:1:"0";s:12:"entity_types";a:0:{}s:8:"settings";a:6:{s:11:"granularity";a:6:{s:5:"month";s:5:"month";s:3:"day";s:3:"day";s:4:"hour";i:0;s:6:"minute";i:0;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: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:34:"field_data_field_date_without_time";a:1:{s:5:"value";s:29:"field_date_without_time_value";}}s:19:"FIELD_LOAD_REVISION";a:1:{s:38:"field_revision_field_date_without_time";a:1:{s:5:"value";s:29:"field_date_without_time_value";}}}}}s:12:"foreign keys";a:0:{}s:7:"indexes";a:0:{}s:2:"id";s:1:"9";}',
|
||||
'cardinality' => '1',
|
||||
'translatable' => '0',
|
||||
'deleted' => '0',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('field_config_instance', array(
|
||||
|
@ -4188,24 +4158,6 @@ $connection->insert('field_config_instance')
|
|||
'data' => 'a:7:{s:5:"label";s:31:"Text summary plain and filtered";s:6:"widget";a:5:{s:6:"weight";s:2:"14";s:4:"type";s:26:"text_textarea_with_summary";s:6:"module";s:4:"text";s:6:"active";i:1;s:8:"settings";a:2:{s:4:"rows";s:2:"20";s:12:"summary_rows";i:5;}}s:8:"settings";a:3:{s:15:"text_processing";s:1:"1";s:15:"display_summary";i:0;s:18:"user_register_form";b:0;}s:7:"display";a:1:{s:7:"default";a:5:{s:5:"label";s:5:"above";s:4:"type";s:12:"text_default";s:8:"settings";a:0:{}s:6:"module";s:4:"text";s:6:"weight";i:9;}}s:8:"required";i:0;s:11:"description";s:0:"";s:13:"default_value";N;}',
|
||||
'deleted' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'id' => '61',
|
||||
'field_id' => '35',
|
||||
'field_name' => 'field_datetime_without_time',
|
||||
'entity_type' => 'node',
|
||||
'bundle' => 'test_content_type',
|
||||
'data' => 'a:6:{s:5:"label";s:21:"Datetime without time";s:6:"widget";a:5:{s:6:"weight";s:1:"2";s:4:"type";s:11:"date_select";s:6:"module";s:4:"date";s:6:"active";i:1;s:8:"settings";a:6:{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";s:2:"15";s:14:"label_position";s:5:"above";s:10:"text_parts";a:0:{}}}s:8:"settings";a:5:{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:7:"display";a:1:{s:7:"default";a:5:{s:5:"label";s:5:"above";s:4:"type";s:12:"date_default";s:6:"weight";s:1:"3";s:8:"settings";a:5:{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:6:"module";s:4:"date";}}s:8:"required";i:0;s:11:"description";s:0:"";}',
|
||||
'deleted' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'id' => '62',
|
||||
'field_id' => '36',
|
||||
'field_name' => 'field_date_without_time',
|
||||
'entity_type' => 'node',
|
||||
'bundle' => 'test_content_type',
|
||||
'data' => 'a:6:{s:5:"label";s:17:"Date without time";s:6:"widget";a:5:{s:6:"weight";s:1:"2";s:4:"type";s:11:"date_select";s:6:"module";s:4:"date";s:6:"active";i:1;s:8:"settings";a:6:{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";s:2:"15";s:14:"label_position";s:5:"above";s:10:"text_parts";a:0:{}}}s:8:"settings";a:5:{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:7:"display";a:1:{s:7:"default";a:5:{s:5:"label";s:5:"above";s:4:"type";s:12:"date_default";s:6:"weight";s:1:"3";s:8:"settings";a:5:{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:6:"module";s:4:"date";}}s:8:"required";i:0;s:11:"description";s:0:"";}',
|
||||
'deleted' => '0',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('field_data_body', array(
|
||||
|
@ -4663,171 +4615,6 @@ $connection->insert('field_data_field_date_with_end_time')
|
|||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('field_data_field_datetime_without_time', 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' => 'normal',
|
||||
'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_datetime_without_time_value' => array(
|
||||
'mysql_type' => 'datetime',
|
||||
'not null' => FALSE,
|
||||
),
|
||||
),
|
||||
'primary key' => array(
|
||||
'entity_type',
|
||||
'deleted',
|
||||
'entity_id',
|
||||
'language',
|
||||
'delta',
|
||||
),
|
||||
'mysql_character_set' => 'utf8',
|
||||
));
|
||||
|
||||
$connection->insert('field_data_field_datetime_without_time')
|
||||
->fields(array(
|
||||
'entity_type',
|
||||
'bundle',
|
||||
'deleted',
|
||||
'entity_id',
|
||||
'revision_id',
|
||||
'language',
|
||||
'delta',
|
||||
'field_datetime_without_time_value',
|
||||
))
|
||||
->values(array(
|
||||
'entity_type' => 'node',
|
||||
'bundle' => 'test_content_type',
|
||||
'deleted' => '0',
|
||||
'entity_id' => '1',
|
||||
'revision_id' => '1',
|
||||
'language' => 'und',
|
||||
'delta' => '0',
|
||||
'field_datetime_without_time_value' => '2015-01-20 00:00:00',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('field_data_field_date_without_time', 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' => 'normal',
|
||||
'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_date_without_time_value' => array(
|
||||
'type' => 'varchar',
|
||||
'not null' => FALSE,
|
||||
'length' => '100',
|
||||
),
|
||||
),
|
||||
'primary key' => array(
|
||||
'entity_type',
|
||||
'deleted',
|
||||
'entity_id',
|
||||
'language',
|
||||
'delta',
|
||||
),
|
||||
'mysql_character_set' => 'utf8',
|
||||
));
|
||||
|
||||
$connection->insert('field_data_field_date_without_time')
|
||||
->fields(array(
|
||||
'entity_type',
|
||||
'bundle',
|
||||
'deleted',
|
||||
'entity_id',
|
||||
'revision_id',
|
||||
'language',
|
||||
'delta',
|
||||
'field_date_without_time_value',
|
||||
))
|
||||
->values(array(
|
||||
'entity_type' => 'node',
|
||||
'bundle' => 'test_content_type',
|
||||
'deleted' => '0',
|
||||
'entity_id' => '1',
|
||||
'revision_id' => '1',
|
||||
'language' => 'und',
|
||||
'delta' => '0',
|
||||
'field_date_without_time_value' => '2015-01-20T00:00:00',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('field_data_field_email', array(
|
||||
'fields' => array(
|
||||
'entity_type' => array(
|
||||
|
@ -8014,173 +7801,6 @@ $connection->insert('field_revision_field_date_with_end_time')
|
|||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('field_revision_field_datetime_without_time', 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' => 'normal',
|
||||
'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_datetime_without_time_value' => array(
|
||||
'mysql_type' => 'datetime',
|
||||
'not null' => FALSE,
|
||||
),
|
||||
),
|
||||
'primary key' => array(
|
||||
'entity_type',
|
||||
'deleted',
|
||||
'entity_id',
|
||||
'revision_id',
|
||||
'language',
|
||||
'delta',
|
||||
),
|
||||
'mysql_character_set' => 'utf8',
|
||||
));
|
||||
|
||||
$connection->insert('field_revision_field_datetime_without_time')
|
||||
->fields(array(
|
||||
'entity_type',
|
||||
'bundle',
|
||||
'deleted',
|
||||
'entity_id',
|
||||
'revision_id',
|
||||
'language',
|
||||
'delta',
|
||||
'field_datetime_without_time_value',
|
||||
))
|
||||
->values(array(
|
||||
'entity_type' => 'node',
|
||||
'bundle' => 'test_content_type',
|
||||
'deleted' => '0',
|
||||
'entity_id' => '1',
|
||||
'revision_id' => '1',
|
||||
'language' => 'und',
|
||||
'delta' => '0',
|
||||
'field_datetime_without_time_value' => '2015-01-20 00:00:00',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('field_revision_field_date_without_time', 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' => 'normal',
|
||||
'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_date_without_time_value' => array(
|
||||
'type' => 'varchar',
|
||||
'not null' => FALSE,
|
||||
'length' => '100',
|
||||
),
|
||||
),
|
||||
'primary key' => array(
|
||||
'entity_type',
|
||||
'deleted',
|
||||
'entity_id',
|
||||
'revision_id',
|
||||
'language',
|
||||
'delta',
|
||||
),
|
||||
'mysql_character_set' => 'utf8',
|
||||
));
|
||||
|
||||
$connection->insert('field_revision_field_date_without_time')
|
||||
->fields(array(
|
||||
'entity_type',
|
||||
'bundle',
|
||||
'deleted',
|
||||
'entity_id',
|
||||
'revision_id',
|
||||
'language',
|
||||
'delta',
|
||||
'field_date_without_time_value',
|
||||
))
|
||||
->values(array(
|
||||
'entity_type' => 'node',
|
||||
'bundle' => 'test_content_type',
|
||||
'deleted' => '0',
|
||||
'entity_id' => '1',
|
||||
'revision_id' => '1',
|
||||
'language' => 'und',
|
||||
'delta' => '0',
|
||||
'field_date_without_time_value' => '2015-01-20T00:00:00',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('field_revision_field_email', array(
|
||||
'fields' => array(
|
||||
'entity_type' => array(
|
||||
|
|
|
@ -52,8 +52,8 @@ class MigrateUpgrade7Test extends MigrateUpgradeTestBase {
|
|||
'configurable_language' => 4,
|
||||
'contact_form' => 3,
|
||||
'editor' => 2,
|
||||
'field_config' => 63,
|
||||
'field_storage_config' => 46,
|
||||
'field_config' => 61,
|
||||
'field_storage_config' => 44,
|
||||
'file' => 3,
|
||||
'filter_format' => 7,
|
||||
'image_style' => 6,
|
||||
|
|
Loading…
Reference in New Issue