Problem/Motivation
D7 + entity_translations 7.x-1.0-beta7
While using NodeComplete.php as source plugin for migrating a nodes from D7 to D9, we discovered the status column value of entity_translation_revision was not used as the source of import on the original source of translation. Which makes some nodes that have their original language being unpublished on d7, now published on d9 after migration.
Scenario:
D7
original language: unpublished
en-US: published

Becomes
D9
original language: published
en-US: published

Compare table of node_revision against entity_translation_revision upon their publish status


Steps to reproduce
Proposed resolution
Alter the prepareRow() in NodeComplete.php by replacing 'status' with 'etr_status'
/**
* {@inheritdoc}
*/
public function prepareRow(Row $row) {
// Override properties when this is an entity translation revision. The tnid
// will be set in d7_node source plugin to the value of 'nid'.
if ($row->getSourceProperty('etr_created')) {
$row->setSourceProperty('vid', $row->getSourceProperty('revision_id'));
$row->setSourceProperty('status', $row->getSourceProperty('etr_status')); <--- add this line
$row->setSourceProperty('created', $row->getSourceProperty('etr_created'));
$row->setSourceProperty('timestamp', $row->getSourceProperty('etr_changed'));
$row->setSourceProperty('revision_uid', $row->getSourceProperty('etr_uid'));
$row->setSourceProperty('source_langcode', $row->getSourceProperty('source'));
}
return parent::prepareRow($row);
}
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comments
Comment #2
g-brodieiProvide patch without test. This patch solved the issue by setting/override the status source value we needed from entity_translation_revision table over node_revision table on NodeComplete.php file.
Update new image of query results comparing node_revision table and entity_translation_revision table on the same node's revision ID 13466.
Might need test?
Comment #3
quietone commented@g-brodiei, thanks for the issue and patch.
On a cursory look, this makes sense to me. And yes, this will need a test. The status field is tested in MigrateNodeCompleteTest and it is always '1'. I think we need to either edit a node in the D7 fixture or add a new node.
Comment #5
quietone commentedJust updating tags,
Comment #7
g-brodieiFix summary pointing to wrong language. Japanese to en-US
Comment #9
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.