- First commit to issue fork.
When you have multiple source migrations like this:
process:
uid:
plugin: migration_lookup
migration:
- users
- members
source: author
the
documentation β
says that
If the migration does not find the source ID in the migration map it will create a stub entity for the relationship to use. This stub is generated by the migration provided. In the case of multiple migrations the first value of migration list will be used, but you can select the migration you wish to use to create the stub
Even the code seems to suggest that that is the intention:
if (!$destination_ids && ($self || isset($this->configuration['stub_id']) || count($migrations) == 1)) {
// If the lookup didn't succeed, figure out which migration will do the
// stubbing.
if ($self) {
$migration = $this->migration;
}
elseif (isset($this->configuration['stub_id'])) {
$migration = $migrations[$this->configuration['stub_id']];
}
else {
$migration = reset($migrations);
}
But that last else
can never be reached.
$destination_ids
is empty so that part of the condition is satisfied.
count($migrations)
equals 2 so the last part of the condition is ignored.
This means that either $self
is true or $this->configuration['stub_id']
is set.
In the first case the top branch of the if/elseif/else is executed
In the second case the middle branch is executed.
The third can never be executed.
Workaround: specify a stub_id
in your migration.
Needs work
10.1 β¨
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.