Many migrate plugins are directly exposed on the yml files, so they can be overridden.
Id map migrate plugins are not exposed from migrate plus.
Here is one use case. I have a D6 or D7 site that creates Article nodes from a feed, using the Feeds module. When I migrate the site to D8, I want to create Article nodes from two sources:
In order to make sure that I do not import the same article twice (once from each source), I would like to use the same mapping table for both sources. The mapping table is defined by the Id map plugin, so I would like to be able to specify that in my migration.
Expose the Id map in the migration config, i.e. change the schema.
Once the idMap
key is added to a migration, it is used in the core Migration object: see core/modules/migrate/src/Plugin/Migration.php
:
public function __construct(/* ... */) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
// ...
foreach (NestedArray::mergeDeep($plugin_definition, $configuration) as $key => $value) {
$this->$key = $value;
}
// ...
public function getIdMap() {
if (!isset($this->idMapPlugin)) {
$configuration = $this->idMap;
$plugin = isset($configuration['plugin']) ? $configuration['plugin'] : 'sql';
$this->idMapPlugin = $this->idMapPluginManager->createInstance($plugin, $configuration, $this);
}
return $this->idMapPlugin;
}
N.A.
The idMap
key is allowed on the root level of a migrate_plus.migration.*
config object.
N.A.
Needs review
5.0
API
The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.