diff --git a/core/lib/Drupal/Core/Field/Plugin/migrate/cckfield/NodeReference.php b/core/lib/Drupal/Core/Field/Plugin/migrate/cckfield/NodeReference.php index 8e25279..4effc53 100644 --- a/core/lib/Drupal/Core/Field/Plugin/migrate/cckfield/NodeReference.php +++ b/core/lib/Drupal/Core/Field/Plugin/migrate/cckfield/NodeReference.php @@ -7,6 +7,7 @@ namespace Drupal\Core\Field\Plugin\migrate\cckfield; +use Drupal\migrate\Plugin\MigrateProcessInterface; use Drupal\migrate\Plugin\Migration; use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate\MigrateExecutable; @@ -96,15 +97,24 @@ protected function migrateNodeTypes($source_node_types) { 'migration' => $this->nodeTypeMigration, ]; - $migration = Migration::create(); - $executable = new MigrateExecutable($migration, new MigrateMessage()); $row = new Row([], []); - $migrationPlugin = $this->migratePluginManager + + /** + * @var MigrationInterface $migration + */ + $migration = \Drupal::service('plugin.manager.migration')->createStubMigration([]); + + /** + * @var MigrateProcessInterface $migrationProcessPlugin + */ + $migrationProcessPlugin = $this->migratePluginManager ->createInstance('migration', $migration_plugin_configuration, $migration); + $executable = new MigrateExecutable($migration, new MigrateMessage()); + $node_types = []; - foreach ($source_node_types as $role) { - $node_types[] = $migrationPlugin->transform($role, $executable, $row, NULL); + foreach ($source_node_types as $node_type) { + $node_types[] = $migrationProcessPlugin->transform($node_type, $executable, $row, NULL); } return array_combine($node_types, $node_types); } diff --git a/core/lib/Drupal/Core/Field/Plugin/migrate/cckfield/UserReference.php b/core/lib/Drupal/Core/Field/Plugin/migrate/cckfield/UserReference.php index cfa3e37..f1706c1 100644 --- a/core/lib/Drupal/Core/Field/Plugin/migrate/cckfield/UserReference.php +++ b/core/lib/Drupal/Core/Field/Plugin/migrate/cckfield/UserReference.php @@ -8,6 +8,7 @@ namespace Drupal\Core\Field\Plugin\migrate\cckfield; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; +use Drupal\migrate\Plugin\MigrateProcessInterface; use Drupal\migrate\Plugin\Migration; use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate\MigrateExecutable; @@ -103,15 +104,24 @@ protected function migrateUserRoles($source_roles) { 'migration' => $this->userRoleMigration, ]; - $migration = Migration::create(); - $executable = new MigrateExecutable($migration, new MigrateMessage()); $row = new Row([], []); - $migrationPlugin = $this->migratePluginManager - ->createInstance('migration',$migration_plugin_configuration, $migration); + + /** + * @var MigrationInterface $migration + */ + $migration = \Drupal::service('plugin.manager.migration')->createStubMigration([]); + + /** + * @var MigrateProcessInterface $migrationProcessPlugin + */ + $migrationProcessPlugin = $this->migratePluginManager + ->createInstance('migration', $migration_plugin_configuration, $migration); + + $executable = new MigrateExecutable($migration, new MigrateMessage()); $roles = []; foreach ($source_roles as $role) { - $roles[] = $migrationPlugin->transform($role, $executable, $row, NULL); + $roles[] = $migrationProcessPlugin->transform($role, $executable, $row, NULL); } return array_combine($roles, $roles); }