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
Migrating fieldable entities is a problem because it's not known ahead of the time what the fields will be so it is not possible to write a configuration entity YAML. More, it's not even known what the migrations themselves will be (!) because we need one per node type.
Proposed resolution
Add a load plugin subsystem. It allows entity_load_multiple('migration', array('d6_node:*'))
.
Remaining tasks
Reach consensus and commit this. This will be tested with the node migration. The point of this issue is to create reviewable-size patches.
User interface changes
None.
API changes
Adds the load top level key to migration.
Comment | File | Size | Author |
---|---|---|---|
#16 | 2190561_16.patch | 7.54 KB | benjy |
#14 | interdiff.txt | 5.79 KB | chx |
#14 | 2190561_14.patch | 12.21 KB | chx |
Comments
Comment #1
chx CreditAttribution: chx commentedComment #2
tim.plunkettI don't fully understand why we don't change the Migration entity annotation to use this new controller.
The rest are nitpicks, the logic seems fine.
This could use some inline docs. especially around the str functions, please.
This should be\Drupal\migrate\MigrationStorageController
This calls for an interface
Missing typehint and default values
Missing typehint
ahem
We use (and the rest of the patch mostly does) full class names here
migrate_drupal
Comment #3
dawehnerAs I got really confused it would be great to document why using an entity query would not solve the problem.
Comment #4
chx CreditAttribution: chx commentedColor *me* confused. An entity query against *what* ? We are creating configuration entities out of thin air!
Or you mean why we dont run an entity query against the D6 database? o_O
Comment #5
pcambraHere's a new patch with the comments in #7 applied for review.
Comment #6
pcambraOops now the patch, the interdiff above corresponds to the patch in this comment.
Comment #9
penyaskito6: 2190561-migrate-load-plugins-5.patch queued for re-testing.
Comment #10
penyaskitoRetesting, failures were unrelated.
Comment #11
eliza411 CreditAttribution: eliza411 commentedAs I understand it, this patch is an attempt to keep patches at a reviewable size. The change isn't wired in because the only way to test the controller is to include the entire node or vocabulary migration, at which point the patch becomes so large that this might have been lost in the rest of it. Actually wiring it in without one of those two migrations would be asking to commit an untested storage controller, and that would be asking for trouble.
Comment #12
chx CreditAttribution: chx commentedThis patch
mapArray
as it is gone from corepublic
qualifiers to methodsThis allows
d6_block
to haveimplying that if
d6_menu
runs that then it needs to run first; but if it doesn't run; we are still good.Comment #13
chx CreditAttribution: chx commentedNote the difference between requirements and dependencies are explained in painstaking detail in the Migration entity in the $requirements and the $dependencies properties doxygen:
Comment #14
chx CreditAttribution: chx commentedAdded the docs inline as well. Interdiff against #6.
Comment #15
chx CreditAttribution: chx commentedOn careful consideration we will move this to migrate_drupal. It is not necessary for custom migrations, it is somewhat confusing and altogether quite a bit ugly. Whille for example WordPress has the concept of custom post types , nothing stops the WordPress - to - Drupal module from depending on migrate_drupal. Ugly to the ugly. Fits.
Comment #16
benjy CreditAttribution: benjy commentedWe now need to add this into migrate_drupal before we can post the D6-D8 patch so attached is the load entity patch.
Comment #17
penyaskitoI have been away from migrate for some weeks and I don't clearly understand the reasoning for changing your mind.
Anyway, I agree that this should be part of migrate.
Logic is already battle-ready because it is working for D6 migrations.
I checked docs and code standards and couldn't find anything wrong.
The lack of tests will be fixed once the D6 migrations are committed.
So... marking as RTBC for moving forward with IMP.
Comment #18
benjy CreditAttribution: benjy commentedWe always needed it, we just decided to move it from migrate into migrate_drupal.
Comment #19
chx CreditAttribution: chx commentedAnd the reason for that -- we tried to make the system generic but it turned out to be a no-go so then why burden the API module with it?
Comment #20
alexpottLooking forward to the d6 migration patch :)
Committed 23b38b7 and pushed to 8.x. Thanks!
Fixed during commit.