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
In #2935951-27: Copy migrate source plugin from migrate_drupal_d8 into migrate_drupal, it was caught that the source_module wasn't correctly set for this new source plugin. Which brought up a good question, why wasn't this caught in tests. Let's investigate and fix.
Proposed resolution
Investigate
Remaining tasks
- Investigate
- Fix
- Review
User interface changes
n/a
API changes
n/a
Data model changes
n/a
Comment | File | Size | Author |
---|---|---|---|
#9 | interdifft.txt | 1.73 KB | quietone |
#9 | 2937045-9.patch | 1.92 KB | quietone |
#5 | 2937045-5.patch | 1.77 KB | quietone |
#5 | 2937045-5-fail.patch | 2.36 KB | quietone |
Comments
Comment #3
heddnWe should also check on empty source module.
Comment #4
quietone CreditAttribution: quietone as a volunteer commentedThe problem is that testProvidersExist() get all the migrations and then checks the source plugins on each migration and thus misses any source plugin that is not given in a migration. I've got a draft patch working but it is too late to finish it now.
Comment #5
quietone CreditAttribution: quietone as a volunteer commentedAnd the original test missed all the derived versions as well.
This version gets all the source plugin definitions and tests for source_module against all the definitions. The test checks if it is the 'empty' plugin and tests that that plugin does not have a source_module definition.
The fail patch is with content_entity set to source_provider, which is what is was when the problem was identified.
Comment #7
quietone CreditAttribution: quietone as a volunteer commentedComment #8
heddnThis is all fine and well, but that means the empty source plugin cannot be used as a Drupal source as we will throw an exception in that case. Could/should we add a source_module of 'migrate' to specify its source data is coming from the migrate system itself? Or somehow add more documentation on it for when it should be used. I'm fine if we opt for a follow-up if all we plan to do is add docs.
Comment #9
quietone CreditAttribution: quietone as a volunteer commentedYes, we already have embedded_source with a source_module = 'migrate' and source_module is now required so it must be required everywhere. I made this patch with that in mind.
Comment #10
heddnPerfect. Let's get this merged.
Comment #11
phenaproxima+1 for RTBC.
Comment #12
heddnSoft blocking #2923810: Throw exception for destination plugins without a destination_module property on this issue.
Comment #14
MixologicTemporary testbot hiccup.
Comment #16
quietone CreditAttribution: quietone as a volunteer commentedRetesting
Comment #17
quietone CreditAttribution: quietone as a volunteer commentedRerun test to be sure and it is still passing tests. Back to RTBC
Comment #18
alexpottCrediting @heddn for reviewing the patch.
Comment #19
alexpottCommitted and pushed 9d04cb49bd to 8.6.x and f4d44ba1ab to 8.5.x. Thanks!