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

Comments

danflanagan8 created an issue. See original summary.

danflanagan8’s picture

Status: Active » Needs review
StatusFileSize
new11.69 KB

Here'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 source configuration property. That'll be the hardest part of all this.

danflanagan8’s picture

Version: 2.0.x-dev » 2.1.x-dev

We'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.

danflanagan8’s picture

Adding credit for @xurizaemon since I got this idea from him.

  • danflanagan8 committed 86d3e5e on 2.1.x
    Issue #3319183 by danflanagan8, xurizaemon: Allow declaring source for...
danflanagan8’s picture

Status: Needs review » Fixed

I'll put out a release soon. I also have quite a bit of documentation to update!

xurizaemon’s picture

Thanks for the credit - saw this in my inbox and was thinking wat, I don't recall doing this? 😂

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.