diff --git a/core/modules/migrate/src/Plugin/migrate/process/Migration.php b/core/modules/migrate/src/Plugin/migrate/process/Migration.php index 9a4f83c..437293b 100644 --- a/core/modules/migrate/src/Plugin/migrate/process/Migration.php +++ b/core/modules/migrate/src/Plugin/migrate/process/Migration.php @@ -82,12 +82,8 @@ public function transform($value, MigrateExecutableInterface $migrate_executable /** @var \Drupal\migrate\Entity\MigrationInterface[] $migrations */ $destination_ids = NULL; $source_id_values = array(); - $migrations = array(); - $candidates = array(); - foreach ($migration_ids as $migration_id) { - $candidates += $this->migrationPluginManager->createInstances($migration_id); - } - foreach ($candidates as $migration_id => $migration) { + $migrations = $this->migrationPluginManager->createInstances($migration_ids); + foreach ($migrations as $migration_id => $migration) { if ($migration_id == $this->migration->id()) { $self = TRUE; } @@ -104,7 +100,6 @@ public function transform($value, MigrateExecutableInterface $migrate_executable if ($destination_ids = $migration->getIdMap()->lookupDestinationID($source_id_values[$migration_id])) { break; } - $migrations[] = $migration; } if (!$destination_ids && !empty($this->configuration['no_stub'])) { diff --git a/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php b/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php index 6935470..597492a 100644 --- a/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php +++ b/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php @@ -47,7 +47,7 @@ protected function getEntityCounts() { 'editor' => 2, 'field_config' => 61, 'field_storage_config' => 42, - 'file' => 4, + 'file' => 6, 'filter_format' => 8, 'image_style' => 5, 'migration' => 105, diff --git a/core/modules/user/migration_templates/d6_user.yml b/core/modules/user/migration_templates/d6_user.yml index 6d5795b..bf6ec2a 100644 --- a/core/modules/user/migration_templates/d6_user.yml +++ b/core/modules/user/migration_templates/d6_user.yml @@ -26,6 +26,7 @@ process: plugin: migration migration: d6_user_picture_file source: uid + no_stub: true destination: plugin: entity:user md5_passwords: true diff --git a/core/modules/user/src/Tests/Migrate/d6/MigrateUserTest.php b/core/modules/user/src/Tests/Migrate/d6/MigrateUserTest.php index 4bc7c77..4f86d74 100644 --- a/core/modules/user/src/Tests/Migrate/d6/MigrateUserTest.php +++ b/core/modules/user/src/Tests/Migrate/d6/MigrateUserTest.php @@ -116,6 +116,10 @@ public function testUser() { $file = File::load($user->user_picture->target_id); $this->assertIdentical(basename($source->picture), $file->getFilename()); } + else { + // Ensure the user does not have a picture. + $this->assertFalse($user->user_picture->target_id, sprintf('User %s does not have a picture', $user->id())); + } // Use the API to check if the password has been salted and re-hashed to // conform to Drupal >= 7 for non-admin users.