Problem/Motivation
The migration process plugin provides lookup of entities managed by a designated migration, with the optional stubbing fallback to create a minimum viable entry in the destination that can be revisited with a second pass when the source data is migrated at a later time.
If you disable stubbing, the migration process plugin returns NULL which prevents meaningfully chaining follow-up actions to handle the value. If you enable stubbing, you have no ability to programmatically affect how the stubbing happens. The Source plugin associated with the migration does not even have a chance to run prepareRow().
Proposed resolution
Wrap the line that generates the row in a separate method on the migration process plugin so customizations of this plugin can manipulate stubbing without needing to duplicate code, duplicate execution, or "trick" the migration process plugin by configuring the custom, extending plugin with no_stub so the customization in the plugin can handle the stubbing anyway, making for a confusing configuration.
$stub_row = new Row($values + $migration->getSourceConfiguration(), $source_ids, TRUE);
becomes
<?php
$stub_row = $this->createRow($values, $migration->getSourceConfiguration(), $source_ids);
<?php
Remaining tasks
Code & Tests
User interface changes
None.
API changes
API addition for process plugins extending migration.
Data model changes
None.
Comments
Comment #2
Grayside CreditAttribution: Grayside at Phase2 for Norwegian Cruise Line commentedI just realized that with some smart "fallback default" custom process plugins, you can back in a lot of the customizations this change would facilitate. On that basis dropping to Priority Minor.
Comment #4
quietone CreditAttribution: quietone as a volunteer commentedAdd related issues.
Comment #8
quietone CreditAttribution: quietone as a volunteer commentedUpdate the title with the new name of the plugin.
Comment #18
mikelutzStub creation was moved to a service in #3004927: Create Migration Lookup and Stub services making it overrideable.