- Merge request !2213Issue #3278368: Provide a way to unset empty Migrate Row destinations β (Closed) created by codebymikey
- πΊπΈUnited States amaisano Boston
Not sure if this is 100% the same problem, but I solved this by completely rejecting migration mappings from entering the database if arbitrary criteria was not met. I did this by extending the skip_on_empty plugin to what I call exclude_on_empty.
class ExcludeOnEmpty extends SkipOnEmpty { /** * Excludes the current row when value is not set. * * {@inheritDoc} */ public function row($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { try { return parent::row($value, $migrate_executable, $row, $destination_property); } catch (MigrateSkipRowException $e) { throw new MigrateSkipRowException($e->getMessage(), FALSE); } } }
- πΊπΈUnited States danflanagan8 St. Louis, US
Here's a process-plugin approach to the same basic problem: β¨ Add set_on_condition process plugin Needs review
I'm not sure it's a good idea, but I wanted to throw it out there.
- Merge request !9869Issue #3278368: Provide a way to unset empty Migrate Row destinations β (Open) created by codebymikey
Thanks @danflanagan8, I think this issue addresses a different situation, which is related to the fact that the empty value gets out of sync with the actual state of the row field.
I've updated the issue summary accordingly.