diff --git a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceTest.php b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceTest.php index c2beda0..8d42c2d 100644 --- a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceTest.php +++ b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceTest.php @@ -210,7 +210,7 @@ public function testFieldInstanceMigration() { 'include_anonymous' => FALSE, 'filter' => [ 'type' => 'role', - 'role' => ['authenticated' => 'authenticated',], + 'role' => ['authenticated' => 'authenticated'], ], 'target_bundles' => NULL, ]; diff --git a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php index 23c4dbc..d74c8d0 100644 --- a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php +++ b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php @@ -35,9 +35,10 @@ public function testWidgetSettings() { // Text field. $component = $form_display->getComponent('field_test'); - $expected = ['weight' => 1, 'type' => 'text_textfield']; - $expected['settings'] = ['size' => 60, 'placeholder' => '']; + $expected = ['weight' => 1]; + $expected['settings'] = ['placeholder' => '', 'rows' => 5]; $expected['third_party_settings'] = []; + $expected['type'] = 'text_textarea'; $expected['region'] = 'content'; $this->assertIdentical($expected, $component, 'Text field settings are correct.'); @@ -48,6 +49,7 @@ public function testWidgetSettings() { $expected['type'] = 'number'; $expected['settings'] = ['placeholder' => '']; $expected['third_party_settings'] = []; + $expected['region'] = 'content'; $this->assertIdentical($expected, $component); // Float field. @@ -57,6 +59,7 @@ public function testWidgetSettings() { $expected['type'] = 'number'; $expected['settings'] = ['placeholder' => '']; $expected['third_party_settings'] = []; + $expected['region'] = 'content'; $this->assertIdentical($expected, $component); // Email field. @@ -66,6 +69,7 @@ public function testWidgetSettings() { $expected['type'] = 'email_default'; $expected['settings'] = ['placeholder' => '', 'size' => 60]; $expected['third_party_settings'] = []; + $expected['region'] = 'content'; $this->assertIdentical($expected, $component); // Link field. @@ -81,6 +85,7 @@ public function testWidgetSettings() { $expected['type'] = 'file_generic'; $expected['settings'] = ['progress_indicator' => 'bar']; $expected['third_party_settings'] = []; + $expected['region'] = 'content'; $this->assertIdentical($expected, $component); // Image field. @@ -90,6 +95,7 @@ public function testWidgetSettings() { $expected['settings'] = ['progress_indicator' => 'bar', 'preview_image_style' => 'thumbnail']; $expected['third_party_settings'] = []; $expected['type'] = 'image_image'; + $expected['region'] = 'content'; $this->assertIdentical($expected, $component); // Phone field. @@ -99,15 +105,17 @@ public function testWidgetSettings() { $expected['type'] = 'telephone_default'; $expected['settings'] = ['placeholder' => '']; $expected['third_party_settings'] = []; + $expected['region'] = 'content'; $this->assertIdentical($expected, $component); // Date fields. $component = $form_display->getComponent('field_test_date'); $expected = []; $expected['weight'] = 10; - $expected['type'] = 'datetime_default'; $expected['settings'] = []; $expected['third_party_settings'] = []; + $expected['type'] = 'datetime_default'; + $expected['region'] = 'content'; $this->assertIdentical($expected, $component); $component = $form_display->getComponent('field_test_datestamp'); @@ -116,14 +124,16 @@ public function testWidgetSettings() { $expected['type'] = 'datetime_default'; $expected['settings'] = []; $expected['third_party_settings'] = []; + $expected['region'] = 'content'; $this->assertIdentical($expected, $component); $component = $form_display->getComponent('field_test_datetime'); $expected = []; $expected['weight'] = 12; - $expected['type'] = 'datetime_default'; $expected['settings'] = []; $expected['third_party_settings'] = []; + $expected['type'] = 'datetime_default'; + $expected['region'] = 'content'; $this->assertIdentical($expected, $component); $component = entity_get_form_display('node', 'employee', 'default') diff --git a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldSettingsTest.php b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldSettingsTest.php index 7c607dd..aa0b726 100644 --- a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldSettingsTest.php +++ b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldSettingsTest.php @@ -4,7 +4,6 @@ use Drupal\Component\Plugin\Exception\PluginNotFoundException; use Drupal\field\Plugin\migrate\process\d6\FieldSettings; -use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate\MigrateExecutableInterface; use Drupal\migrate\Plugin\MigratePluginManager; use Drupal\migrate\Row; diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/field/ReferenceBase.php b/core/modules/migrate_drupal/src/Plugin/migrate/field/ReferenceBase.php index 9ad816a..4880f53 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/field/ReferenceBase.php +++ b/core/modules/migrate_drupal/src/Plugin/migrate/field/ReferenceBase.php @@ -73,9 +73,7 @@ public function processCckFieldValues(MigrationInterface $migration, $field_name $process = [ 'plugin' => 'iterator', 'source' => $field_name, - 'process' => array( - 'target_id' => $this->entityId(), - ), + 'process' => ['target_id' => $this->entityId()], ]; $migration->setProcessOfProperty($field_name, $process); } diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTranslationTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTranslationTest.php index d21ad1e..a23f30d 100644 --- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTranslationTest.php +++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTranslationTest.php @@ -38,6 +38,8 @@ protected function setUp() { $this->installEntitySchema('taxonomy_term'); $this->installConfig(static::$modules); $this->executeMigrations([ + 'd6_filter_format', + 'd6_user_role', 'd6_node_type', 'd6_field', 'd6_taxonomy_vocabulary', diff --git a/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldTest.php b/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldTest.php index de88d7d..7b27616 100644 --- a/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldTest.php +++ b/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldTest.php @@ -2,7 +2,9 @@ namespace Drupal\Tests\taxonomy\Unit\Plugin\migrate\field; +use Drupal\migrate\Plugin\MigratePluginManager; use Drupal\migrate\Plugin\MigrationInterface; +use Drupal\migrate\Plugin\MigrationPluginManagerInterface; use Drupal\Tests\UnitTestCase; use Drupal\taxonomy\Plugin\migrate\field\TaxonomyTermReference; use Prophecy\Argument; @@ -27,7 +29,10 @@ class TaxonomyTermReferenceFieldTest extends UnitTestCase { * {@inheritdoc} */ protected function setUp() { - $this->plugin = new TaxonomyTermReference([], 'taxonomy', []); + $migration_plugin_manager = $this->prophesize(MigrationPluginManagerInterface::class)->reveal(); + $migrate_process_plugin_manager = $this->prophesize(MigratePluginManager::class)->reveal(); + + $this->plugin = new TaxonomyTermReference([], 'taxonomy', [], $migration_plugin_manager, $migrate_process_plugin_manager); $migration = $this->prophesize(MigrationInterface::class); diff --git a/core/modules/text/src/Plugin/migrate/cckfield/TextField.php b/core/modules/text/src/Plugin/migrate/cckfield/TextField.php index 58d416b..e2511de 100644 --- a/core/modules/text/src/Plugin/migrate/cckfield/TextField.php +++ b/core/modules/text/src/Plugin/migrate/cckfield/TextField.php @@ -136,15 +136,4 @@ public function getFieldType(Row $row) { } } - /** - * {@inheritdoc} - */ - public function transformFieldStorageSettings(Row $row) { - $settings = parent::transformFieldStorageSettings($row); - $global_settings = $row->getSourceProperty('global_settings'); - $max_length = isset($global_settings['max_length']) ? $global_settings['max_length'] : ''; - $settings['max_length'] = empty($max_length) ? 255 : $max_length; - return $settings; - } - } diff --git a/core/modules/text/src/Plugin/migrate/field/d6/TextField.php b/core/modules/text/src/Plugin/migrate/field/d6/TextField.php index 62deeee..cc96a6b 100644 --- a/core/modules/text/src/Plugin/migrate/field/d6/TextField.php +++ b/core/modules/text/src/Plugin/migrate/field/d6/TextField.php @@ -128,4 +128,15 @@ public function getFieldType(Row $row) { } } + /** + * {@inheritdoc} + */ + public function transformFieldStorageSettings(Row $row) { + $settings = parent::transformFieldStorageSettings($row); + $global_settings = $row->getSourceProperty('global_settings'); + $max_length = isset($global_settings['max_length']) ? $global_settings['max_length'] : ''; + $settings['max_length'] = empty($max_length) ? 255 : $max_length; + return $settings; + } + }