- Issue created by @Sardis
We have a Openy Traction Rec module that implements migration from CRM to Drupal. There's a designated drush command that we created: tr:import.
This command accepts --update
flag the same as migrate:import.
It creates new MigrateExecutable object as follows:
// Get an instance of MigrateExecutable.
$migrate_executable = new MigrateExecutable($migration, new MigrateMessage(), $options);
where $options
contains the --update flag.
Link to the code.
We have overlooked the fact that --update flag is not processed in MigrateExecutable constructor and only in the executeMigration method of the MigrateToolsCommands:
if ($options['update']) {
if (!$options['idlist']) {
$migration->getIdMap()->prepareUpdate();
}
else {
$source_id_values_list = MigrateTools::buildIdList($options);
$keys = array_keys($migration->getSourcePlugin()->getIds());
foreach ($source_id_values_list as $source_id_values) {
$migration->getIdMap()->setUpdate(array_combine($keys, $source_id_values));
}
}
}
I am wondering if it would be possible to move this to MigrateExecutable instead? I can provide the PR if we decide on this.
Active
6.0
Code