diff --git a/core/modules/migrate/src/Plugin/Migration.php b/core/modules/migrate/src/Plugin/Migration.php index 7b1e6769cafea0041752bd168223377ac58a60a8..c7d21b22ecac4ee9283f7f5531b4e7ecc4c92712 100644 --- a/core/modules/migrate/src/Plugin/Migration.php +++ b/core/modules/migrate/src/Plugin/Migration.php @@ -278,7 +278,7 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition $this->destinationPluginManager = $destination_plugin_manager; $this->idMapPluginManager = $idmap_plugin_manager; - foreach (NestedArray::mergeDeep($plugin_definition, $configuration) as $key => $value) { + foreach (NestedArray::mergeDeepArray([$plugin_definition, $configuration], TRUE) as $key => $value) { $this->$key = $value; } } diff --git a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginConfigurationTest.php b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginConfigurationTest.php index 827af91ee61ae6640c3527bd6e23f674aca2e995..56cc1f3acbf500c2cff84e218b5a32bda7221fe3 100644 --- a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginConfigurationTest.php +++ b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginConfigurationTest.php @@ -20,6 +20,7 @@ class MigrationPluginConfigurationTest extends KernelTestBase { 'migrate_drupal', // Test with a simple migration. 'ban', + 'locale', ]; /** @@ -27,9 +28,10 @@ class MigrationPluginConfigurationTest extends KernelTestBase { * * @dataProvider mergeProvider */ - public function testConfigurationMerge($configuration, $expected) { + public function testConfigurationMerge($id, $configuration, $expected) { /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */ - $migration = $this->container->get('plugin.manager.migration')->createInstance('d7_blocked_ips', $configuration); + $migration = $this->container->get('plugin.manager.migration') + ->createInstance($id, $configuration); $source_configuration = $migration->getSourceConfiguration(); $this->assertEquals($expected, $source_configuration); } @@ -42,6 +44,7 @@ public function mergeProvider() { // Tests adding new configuration to a migration. [ // New configuration. + 'd7_blocked_ips', [ 'source' => [ 'constants' => [ @@ -60,6 +63,7 @@ public function mergeProvider() { // Tests overriding pre-existing configuration in a migration. [ // New configuration. + 'd7_blocked_ips', [ 'source' => [ 'plugin' => 'a_different_plugin', @@ -70,6 +74,29 @@ public function mergeProvider() { 'plugin' => 'a_different_plugin', ], ], + // New configuration. + [ + 'locale_settings', + [ + 'source' => [ + 'plugin' => 'variable', + 'variables' => [ + 'locale_cache_strings', + 'locale_js_directory', + ], + 'source_module' => 'locale', + ], + ], + // Expected final source and process configuration. + [ + 'plugin' => 'variable', + 'variables' => [ + 'locale_cache_strings', + 'locale_js_directory', + ], + 'source_module' => 'locale', + ], + ], ]; }