diff --git a/core/modules/migrate/src/Entity/Migration.php b/core/modules/migrate/src/Entity/Migration.php index 9fb93b7..102098a 100644 --- a/core/modules/migrate/src/Entity/Migration.php +++ b/core/modules/migrate/src/Entity/Migration.php @@ -41,21 +41,21 @@ class Migration extends ConfigEntityBase implements MigrationInterface, Requirem * * @var string */ - public $id; + protected $id; /** * The human-readable label for the migration. * * @var string */ - public $label; + protected $label; /** * The plugin ID for the row. * * @var string */ - public $row; + protected $row; /** * The source configuration, with at least a 'plugin' key. @@ -64,7 +64,7 @@ class Migration extends ConfigEntityBase implements MigrationInterface, Requirem * * @var array */ - public $source; + protected $source; /** * The source plugin. @@ -78,14 +78,14 @@ class Migration extends ConfigEntityBase implements MigrationInterface, Requirem * * @var array */ - public $process; + protected $process; /** * The configuration describing the load plugins. * * @var array */ - public $load; + protected $load; /** * The cached process plugins. @@ -101,7 +101,7 @@ class Migration extends ConfigEntityBase implements MigrationInterface, Requirem * * @var array */ - public $destination; + protected $destination; /** * The destination plugin. @@ -117,7 +117,7 @@ class Migration extends ConfigEntityBase implements MigrationInterface, Requirem * * @var string */ - public $idMap = array(); + protected $idMap = array(); /** * The identifier map. @@ -134,7 +134,7 @@ class Migration extends ConfigEntityBase implements MigrationInterface, Requirem * * @var array */ - public $sourceIds = array(); + protected $sourceIds = array(); /** * The destination identifiers. @@ -144,14 +144,14 @@ class Migration extends ConfigEntityBase implements MigrationInterface, Requirem * * @var array */ - public $destinationIds = FALSE; + protected $destinationIds = FALSE; /** * Information on the high water mark. * * @var array */ - public $highWaterProperty; + protected $highWaterProperty; /** * Indicate whether the primary system of record for this migration is the @@ -163,7 +163,7 @@ class Migration extends ConfigEntityBase implements MigrationInterface, Requirem * * @var string */ - public $systemOfRecord = self::SOURCE; + protected $systemOfRecord = self::SOURCE; /** * Specify value of source_row_status for current map row. Usually set by @@ -171,7 +171,7 @@ class Migration extends ConfigEntityBase implements MigrationInterface, Requirem * * @var int */ - public $sourceRowStatus = MigrateIdMapInterface::STATUS_IMPORTED; + protected $sourceRowStatus = MigrateIdMapInterface::STATUS_IMPORTED; /** * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface @@ -181,7 +181,7 @@ class Migration extends ConfigEntityBase implements MigrationInterface, Requirem /** * @var bool */ - public $trackLastImported = FALSE; + protected $trackLastImported = FALSE; /** * These migrations must be already executed before this migration can run. @@ -195,7 +195,7 @@ class Migration extends ConfigEntityBase implements MigrationInterface, Requirem * * @var array */ - public $migration_dependencies = array(); + protected $migration_dependencies = array(); /** * The entity manager. diff --git a/core/modules/migrate/src/MigrationStorage.php b/core/modules/migrate/src/MigrationStorage.php index 7577956..cf11dd4 100644 --- a/core/modules/migrate/src/MigrationStorage.php +++ b/core/modules/migrate/src/MigrationStorage.php @@ -27,20 +27,22 @@ public function buildDependencyMigration(array $migrations, array $dynamic_ids) $requirement_graph = array(); $different = FALSE; foreach ($migrations as $migration) { - /** @var \Drupal\migrate\Entity\Migration $migration */ + /** @var \Drupal\migrate\Entity\MigrationInterface $migration */ $id = $migration->id(); $requirements[$id] = array(); $dependency_graph[$id]['edges'] = array(); - if (isset($migration->migration_dependencies['required'])) { - foreach ($migration->migration_dependencies['required'] as $dependency) { + $migration_dependencies = $migration->get('migration_dependencies'); + + if (isset($migration_dependencies['required'])) { + foreach ($migration_dependencies['required'] as $dependency) { if (!isset($dynamic_ids[$dependency])) { $this->addDependency($requirement_graph, $id, $dependency, $dynamic_ids); } $this->addDependency($dependency_graph, $id, $dependency, $dynamic_ids); } } - if (isset($migration->migration_dependencies['optional'])) { - foreach ($migration->migration_dependencies['optional'] as $dependency) { + if (isset($migration_dependencies['optional'])) { + foreach ($migration_dependencies['optional'] as $dependency) { $different = TRUE; $this->addDependency($dependency_graph, $id, $dependency, $dynamic_ids); } diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/load/LoadEntity.php b/core/modules/migrate_drupal/src/Plugin/migrate/load/LoadEntity.php index adbd919..adc6ff6 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/load/LoadEntity.php +++ b/core/modules/migrate_drupal/src/Plugin/migrate/load/LoadEntity.php @@ -92,7 +92,8 @@ public function loadMultiple(EntityStorageInterface $storage, array $sub_ids = N // Specifically process the link field until core is fixed. // @see https://www.drupal.org/node/2235457 if ($data['type'] == 'link') { - $migration->process[$field_name] = [ + $process = $migration->get('process'); + $process[$field_name] = [ 'plugin' => 'd6_cck_link', 'source' => [ $field_name, @@ -100,15 +101,18 @@ public function loadMultiple(EntityStorageInterface $storage, array $sub_ids = N $field_name . '_attributes', ], ]; + $migration->set('process', $process); } else { - $migration->process[$field_name] = $field_name; + $process = $migration->get('process'); + $process[$field_name] = $field_name; + $migration->set('process', $process); } } } else { $fields = array_keys($migration->getSourcePlugin()->fields()); - $migration->process += array_combine($fields, $fields); + $migration->set('process', $migration->get('process') + array_combine($fields, $fields)); } $migrations[$migration->id()] = $migration; } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php index 48645c1..b613f19 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php @@ -34,7 +34,9 @@ protected function setUp() { ); /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', 'd6_file'); - $migration->source['conf_path'] = 'core/modules/simpletest'; + $source = $migration->get('source'); + $source['conf_path'] = 'core/modules/simpletest'; + $migration->set('source', $source); $this->prepare($migration, $dumps); $executable = new MigrateExecutable($migration, $this); $executable->import(); diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFileTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFileTest.php index ff204f7..16e8e1b 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFileTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFileTest.php @@ -34,7 +34,9 @@ protected function setUp() { ); /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', 'd6_user_picture_file'); - $migration->source['conf_path'] = 'core/modules/simpletest'; + $source = $migration->get('source'); + $source['conf_path'] = 'core/modules/simpletest'; + $migration->set('source', $source); $this->prepare($migration, $dumps); $executable = new MigrateExecutable($migration, $this); $executable->import();