Problem/Motivation
Identified while working on Bean Migrate:
The EntityContentComplete migration destination plugin blindly marks every migrated content entity revision as default revision. This is wrong, because a moderated entity might have forward (so not-yet-default or not-yet-published) revisions as well.
Proposed resolution
Check whether the row being migrated has a revision_default destination property.
- If the property's value is FALSE, do not set default revision.
- If the property is not set at all, or its value is NULL, or it has a value, mark the entity revision as default revision.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | core-allow_migrating_forward_revisions-3200949-9.patch | 1.1 KB | huzooka |
| #3 | interdiff-3200949-2-3.txt | 1.32 KB | huzooka |
| #3 | core-allow_migrating_forward_revisions-3200949-3.patch | 1.3 KB | huzooka |
Comments
Comment #2
huzookaComment #3
huzookaComment #4
huzookaComment #5
wim leersAFAICT this also affects the migration of nodes from D7, which on relatively many sites have forward revisions. So that means unpublished forward revisions would get migrated into D8|9 as default revisions 😨
Given that, bumping to .
Of course, having tests that prove this problem are essential for us to land this 😅
Comment #6
wim leersThis is what triggered the
phpcsfailure:Easy fix obviously :)
That'd be worth fixing, to see if this is triggering failures elsewhere in Drupal core tests 🤓
Comment #7
huzookaRe #6 omg, that should be my broken command key :(
Comment #8
huzookaRe #5:
For testing this even with kernel or functional tests, I think that the node revision (or the node translation? or just the node complete?..) migration source plugin should provide source data.
OR
Maybe the migration plugin definition should take care of that destination property?...
(Note: Bean migrate uses the "status" property for this revision default destination prop: if a revision wasn't published, then we can assume that it wasn't ever a default revision.)
Comment #9
huzooka#8 contains a proper patch, but it's not for Drupal core.
Comment #10
wim leersZero test failures suggests that indeed we have no test coverage for this edge case.
Comment #11
huzookaComment #13
wim leersWe need feedback from the migration system maintainers about how they would like to see this tested.
Comment #14
wim leersComment #15
quietone commentedThis seems reasonable to me, although I know very little about Content Moderation. Since the default is set in EntityContentComplete then we need the fixtures changed because the functional tests run with the node complete migrations. I don't know how this will effect the existing Kernel tests though. I am guessing that the two MigrateNodeComplete tests can be updated to check that the default revision is correct.
Hope that helps.
Comment #16
quietone commentedComment #19
firewaller commented+1
Comment #22
quietone commentedThe Migrate Drupal Module was approved for removal in #3371229: [Policy] Migrate Drupal and Migrate Drupal UI after Drupal 7 EOL.
This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
The deprecation work is in #3522602: [meta] Tasks to remove Migrate Drupal module and the removal work in #3522602: [meta] Tasks to remove Migrate Drupal module.
Migrate Drupal will not be moved to a contributed project. It will be removed from core after the Drupal 12.x branch is open.