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 Drupal 8 there was a Migration::get() method. It was appropriately deprecated but I missed that It was being used in Migrate Manifest to bypass the lack of an accessor for listing requirements. Since it is removed in Drupal 9 and there is not replacement, Migrate Manifest is not currently able to upgrade.
Proposed resolution
Add a "getRequirements()" method to Migration class and the MigrationsInterface
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#12 | 3154398-12.patch | 1.85 KB | quietone |
#12 | interdiff-10-12.txt | 463 bytes | quietone |
#10 | 3154398-10.patch | 1.86 KB | quietone |
#10 | interdiff-7-10.txt | 958 bytes | quietone |
#7 | 3154398-7.patch | 1.84 KB | neclimdul |
Comments
Comment #2
neclimdulMigrationInterface might not actually be the right place. Here's a patch with the method on RequirementsInterface.
Comment #3
neclimdulyeah... nope. That's going to fail hard. Requirements interface has a bunch of different contexts its used in and most can't list plugin ids. Going to have to be specific to migrations.
Comment #4
neclimdulLets see how testbot feels about this.
Comment #5
dinarcon CreditAttribution: dinarcon at UnderstandDrupal.com commentedThanks for getting a fix started @neclimdul. This is also affecting the --execute-dependencies flag in Migrate Tools and (probably) Migrate Run. Referencing a related issue where adding a new interface is mentioned.
Comment #6
neclimdulI knew that looked too clever and I didn't remember writing it. I'm sure I stole the idea from Migrate Tools. :-D
Here's a patch with tests. The method doesn't really do much so the test is pretty trivial.
Comment #7
neclimdulYou know, sometimes you don't see things until you see it in the patch review...
}}
Sorry for being lazy about the interdiffs, I have a couple patches i'm working on in the same branch so its a pain. #6 just added the tests. This just fixes the }} in the doc.
Comment #8
heddnEasy enough change here. +1.
Comment #9
alexpottI think this is allowed under our 1-1 interface to class rule - but given we're adding a method to an interface I think we should have a change record.
To prevent future re-work let's add a return typehint. Yes the mix of methods without a return hint and ones with is meh but if adding new things without out this is adding to future work.
Comment #10
quietone CreditAttribution: quietone commented#10 Added a CR and here is a patch with the return type declarations.
Comment #11
neclimdulI'm not sure what our code style for return types is but I assume the spacing on these should be consistent?
Comment #12
quietone CreditAttribution: quietone commentedI couldn't find anything for return types in the coding standards but grep shows the convention is the second one,
public function getRequirements(): array;
. Updated the patch accordingly.There is a change record, so removing tag.
Comment #13
neclimdulawesome. I think this can go back to RTBC.
Comment #15
heddnComment #17
larowlanCommitted 90c7d4c and pushed to 9.1.x. Thanks!
Published the change-record.
Didn't backport this because there's an outside chance of disruption.