Problem/Motivation
This idea stems from a conversation in Slack with @xurizaemon: https://drupal.slack.com/archives/C226VLXBP/p1667381854113159
The gist of it is that there some surprise when @xurizaemon found that source could not be declared for a migrate_condition plugin. Indeed the design has always been that the condition evaluates itself on the source that is used for the process plugin.
After thinking about it a bit, it would be really easy to support setting a source value as part of the condition configuration. All of the necessary logic could be added to the MigrateConditionBase class. There may be a condition or two that needs a little extra update, but this lift is minimal.
Proposed resolution
Update the MigrateConditionBase::evaluate() method such that a configured source is gotten from the Row and used in place of the $source passed as an argument.
User interface changes
N/A
API changes
All migration_conditions plugins will honor source as a configuration property.
Data model changes
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | migrate_conditions-source-3319183-2.patch | 11.69 KB | danflanagan8 |
Comments
Comment #2
danflanagan8Here's a patch that I think has the full implementation and pretty good test coverage.
I still need to update documentation within the module to describe the
sourceconfiguration property. That'll be the hardest part of all this.Comment #3
danflanagan8We're going to put this in a new branch since it's a major change, even though it only has BC implications for code that was written incorrectly.
Comment #5
danflanagan8Adding credit for @xurizaemon since I got this idea from him.
Comment #7
danflanagan8I'll put out a release soon. I also have quite a bit of documentation to update!
Comment #8
xurizaemonThanks for the credit - saw this in my inbox and was thinking wat, I don't recall doing this? 😂