Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Over in #2427335: Combine legacy Source class into SourcePluginBase we combined the legacy Source class with SourcePluginBase. We needed to add a public property to SourcePluginBase for the executable but we should find a better way to handle this dependency.
Proposed resolution
Inject the executable without putting the migration into a state where it sometimes has the executable. Maybe just injecting the executable into the migration when it's constructed.
Remaining tasks
Discuss, write patch
User interface changes
n/a
API changes
possible
Comments
Comment #1
mikeryanRan across this today while messing with prepareRow(). The real question is, why does the source plugin need MigrateExecutable? I see it being used for two things:
Comment #2
benjy CreditAttribution: benjy at CodeDrop commentedYes I think we brought it across from the legacy "Source" class that was using this: $this->migrateExecutable->saveQueuedMessages();
Right now the executable handles saving for good rows and the source for rows we're skipping, we should make this the responsibility for the executable alone but I don't know how easy that is going to be.
Comment #3
mikeryan#2567571: Manage per-row messages more rationally should kill this dead.
Comment #4
mikeryanComment #5
mikeryanFixed by #2567571: Manage per-row messages more rationally.