Issue #2911288 by maxocub, matslats: No mapping to upgrade list_float fields
parent
2defaa4e44
commit
43645ea955
|
@ -283,6 +283,7 @@ class MigrateFieldFormatterSettingsTest extends MigrateDrupal7TestBase {
|
|||
$this->assertComponent('node.test_content_type.default', 'field_link', 'link', 'above', 9);
|
||||
$this->assertComponent('node.test_content_type.default', 'field_text_list', 'list_default', 'above', 10);
|
||||
$this->assertComponent('node.test_content_type.default', 'field_integer_list', 'list_default', 'above', 11);
|
||||
$this->assertComponent('node.test_content_type.default', 'field_float_list', 'list_default', 'above', 19);
|
||||
$this->assertComponent('node.test_content_type.default', 'field_long_text', 'text_default', 'above', 12);
|
||||
$this->assertComponent('node.test_content_type.default', 'field_node_entityreference', 'entity_reference_label', 'above', 15);
|
||||
$this->assertComponent('node.test_content_type.default', 'field_user_entityreference', 'entity_reference_label', 'above', 16);
|
||||
|
|
|
@ -122,6 +122,7 @@ class MigrateFieldInstanceTest extends MigrateDrupal7TestBase {
|
|||
$this->assertEntity('node.test_content_type.field_link', 'Link', 'link', FALSE, FALSE);
|
||||
$this->assertEntity('node.test_content_type.field_text_list', 'Text List', 'list_string', FALSE, FALSE);
|
||||
$this->assertEntity('node.test_content_type.field_integer_list', 'Integer List', 'list_integer', FALSE, FALSE);
|
||||
$this->assertEntity('node.test_content_type.field_float_list', 'Float List', 'list_float', FALSE, FALSE);
|
||||
$this->assertEntity('node.test_content_type.field_long_text', 'Long text', 'text_with_summary', FALSE, FALSE);
|
||||
$this->assertEntity('node.test_content_type.field_term_reference', 'Term Reference', 'entity_reference', FALSE, FALSE);
|
||||
$this->assertEntity('node.test_content_type.field_text', 'Text', 'string', FALSE, FALSE);
|
||||
|
|
|
@ -141,6 +141,7 @@ class MigrateFieldInstanceWidgetSettingsTest extends MigrateDrupal7TestBase {
|
|||
$this->assertComponent('node.test_content_type.default', 'field_term_entityreference', 'entity_reference_autocomplete_tags', 18);
|
||||
$this->assertComponent('node.test_content_type.default', 'field_text', 'string_textfield', 15);
|
||||
$this->assertComponent('node.test_content_type.default', 'field_text_list', 'options_select', 11);
|
||||
$this->assertComponent('node.test_content_type.default', 'field_float_list', 'options_select', 20);
|
||||
|
||||
$this->assertEntity('user.user.default', 'user', 'user');
|
||||
$this->assertComponent('user.user.default', 'field_file', 'file_generic', 8);
|
||||
|
|
|
@ -93,6 +93,7 @@ class MigrateFieldTest extends MigrateDrupal7TestBase {
|
|||
$this->assertEntity('node.taxonomy_forums', 'entity_reference', TRUE, 1);
|
||||
$this->assertEntity('node.field_text', 'string', TRUE, 1);
|
||||
$this->assertEntity('node.field_text_list', 'list_string', TRUE, 3);
|
||||
$this->assertEntity('node.field_float_list', 'list_float', TRUE, 1);
|
||||
$this->assertEntity('node.field_boolean', 'boolean', TRUE, 1);
|
||||
$this->assertEntity('node.field_email', 'email', TRUE, -1);
|
||||
$this->assertEntity('node.field_phone', 'telephone', TRUE, 1);
|
||||
|
|
|
@ -3634,6 +3634,21 @@ $connection->insert('field_config')
|
|||
'translatable' => '0',
|
||||
'deleted' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'id' => '37',
|
||||
'field_name' => 'field_float_list',
|
||||
'type' => 'list_float',
|
||||
'module' => 'list',
|
||||
'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:2:{s:14:"allowed_values";a:2:{s:6:"3.1416";s:2:"Pi";s:6:"6.2832";s:3:"Tau";}s:23:"allowed_values_function";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:27:"field_data_field_float_list";a:1:{s:5:"value";s:22:"field_float_list_value";}}s:19:"FIELD_LOAD_REVISION";a:1:{s:31:"field_revision_field_float_list";a:1:{s:5:"value";s:22:"field_float_list_value";}}}}}s:12:"foreign keys";a:0:{}s:7:"indexes";a:1:{s:5:"value";a:1:{i:0;s:5:"value";}}s:2:"id";s:2:"37";}',
|
||||
'cardinality' => '1',
|
||||
'translatable' => '0',
|
||||
'deleted' => '0',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('field_config_instance', array(
|
||||
|
@ -4234,6 +4249,15 @@ $connection->insert('field_config_instance')
|
|||
'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',
|
||||
))
|
||||
->values(array(
|
||||
'id' => '63',
|
||||
'field_id' => '37',
|
||||
'field_name' => 'field_float_list',
|
||||
'entity_type' => 'node',
|
||||
'bundle' => 'test_content_type',
|
||||
'data' => 'a:7:{s:5:"label";s:10:"Float List";s:6:"widget";a:5:{s:6:"weight";s:2:"20";s:4:"type";s:14:"options_select";s:6:"module";s:7:"options";s:6:"active";i:1;s:8:"settings";a:0:{}}s:8:"settings";a:1:{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:"list_default";s:8:"settings";a:0:{}s:6:"module";s:4:"list";s:6:"weight";i:19;}}s:8:"required";i:0;s:11:"description";s:0:"";s:13:"default_value";N;}',
|
||||
'deleted' => '0',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('field_data_body', array(
|
||||
|
@ -5148,6 +5172,112 @@ $connection->insert('field_data_field_float')
|
|||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('field_data_field_float_list', 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_float_list_value' => array(
|
||||
'type' => 'float',
|
||||
'not null' => FALSE,
|
||||
'size' => 'normal',
|
||||
),
|
||||
),
|
||||
'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',
|
||||
),
|
||||
'field_float_list_value' => array(
|
||||
'field_float_list_value',
|
||||
),
|
||||
),
|
||||
'mysql_character_set' => 'utf8',
|
||||
));
|
||||
|
||||
$connection->insert('field_data_field_float_list')
|
||||
->fields(array(
|
||||
'entity_type',
|
||||
'bundle',
|
||||
'deleted',
|
||||
'entity_id',
|
||||
'revision_id',
|
||||
'language',
|
||||
'delta',
|
||||
'field_float_list_value',
|
||||
))
|
||||
->values(array(
|
||||
'entity_type' => 'node',
|
||||
'bundle' => 'test_content_type',
|
||||
'deleted' => '0',
|
||||
'entity_id' => '1',
|
||||
'revision_id' => '1',
|
||||
'language' => 'und',
|
||||
'delta' => '0',
|
||||
'field_float_list_value' => '3.1416',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('field_data_field_image', array(
|
||||
'fields' => array(
|
||||
'entity_type' => array(
|
||||
|
@ -8507,6 +8637,113 @@ $connection->insert('field_revision_field_float')
|
|||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('field_revision_field_float_list', 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_float_list_value' => array(
|
||||
'type' => 'float',
|
||||
'not null' => FALSE,
|
||||
'size' => 'normal',
|
||||
),
|
||||
),
|
||||
'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',
|
||||
),
|
||||
'field_float_list_value' => array(
|
||||
'field_float_list_value',
|
||||
),
|
||||
),
|
||||
'mysql_character_set' => 'utf8',
|
||||
));
|
||||
|
||||
$connection->insert('field_revision_field_float_list')
|
||||
->fields(array(
|
||||
'entity_type',
|
||||
'bundle',
|
||||
'deleted',
|
||||
'entity_id',
|
||||
'revision_id',
|
||||
'language',
|
||||
'delta',
|
||||
'field_float_list_value',
|
||||
))
|
||||
->values(array(
|
||||
'entity_type' => 'node',
|
||||
'bundle' => 'test_content_type',
|
||||
'deleted' => '0',
|
||||
'entity_id' => '1',
|
||||
'revision_id' => '1',
|
||||
'language' => 'und',
|
||||
'delta' => '0',
|
||||
'field_float_list_value' => '3.1416',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('field_revision_field_image', array(
|
||||
'fields' => array(
|
||||
'entity_type' => array(
|
||||
|
|
|
@ -65,8 +65,8 @@ class MigrateUpgrade7Test extends MigrateUpgradeExecuteTestBase {
|
|||
'configurable_language' => 4,
|
||||
'contact_form' => 3,
|
||||
'editor' => 2,
|
||||
'field_config' => 63,
|
||||
'field_storage_config' => 46,
|
||||
'field_config' => 64,
|
||||
'field_storage_config' => 47,
|
||||
'file' => 3,
|
||||
'filter_format' => 7,
|
||||
'image_style' => 6,
|
||||
|
|
|
@ -164,6 +164,7 @@ class MigrateNodeTest extends MigrateDrupal7TestBase {
|
|||
$this->assertEquals('default@example.com', $node->field_email->value);
|
||||
$this->assertEquals('another@example.com', $node->field_email[1]->value);
|
||||
$this->assertEquals(CommentItemInterface::OPEN, $node->comment_node_test_content_type->status);
|
||||
$this->assertEquals('3.1416', $node->field_float_list[0]->value);
|
||||
|
||||
$node = Node::load(2);
|
||||
$this->assertEquals('en', $node->langcode->value);
|
||||
|
|
|
@ -11,6 +11,7 @@ use Drupal\migrate_drupal\Plugin\migrate\field\FieldPluginBase;
|
|||
* "list_boolean" = "boolean",
|
||||
* "list_integer" = "list_integer",
|
||||
* "list_text" = "list_string",
|
||||
* "list_float" = "list_float",
|
||||
* },
|
||||
* core = {7},
|
||||
* source_module = "list",
|
||||
|
|
Loading…
Reference in New Issue