Problem/Motivation
When I try to migrate a content with translations, the migrate status command detect the total number of rows (original content and translation), but when I migrate it, it only migrate one translation and it does not the default one.
Steps to reproduce
Try to migrate an entity translatable.
Example of migration:
uuid: XXX
langcode: en
status: true
dependencies:
enforced:
module:
- migrate_drupal_d8
id: taxonomy_foo
class: null
field_plugin_method: null
cck_plugin_method: null
migration_tags: null
migration_group: taxonomy
label: 'Foo'
source:
plugin: d8_taxonomy_term
key: legacy
entity_type: taxonomy_term
bundle: foo
id: tid
process:
tid:
-
plugin: original_source_ids (custom)
entity_type: taxonomy_term
source: tid
-
plugin: migration_lookup
migration: taxonomy_foo
-
plugin: skip_on_empty
method: process
-
plugin: node_complete_node_lookup
name: name
weight: weight
uuid: uuid
langcode: langcode
destination:
plugin: 'entity_complete:taxonomy_term'
translations: true
default_bundle: foo
migration_dependencies: { }
The problem is that the query that does the module to get the source, do a join with the table base table (node, taxonomy_term...) and the data table (node_field_data, taxonomy_field_data...), and when migrates the langcode, the migration does not know from wich field take the langcode, and always take the lancode from the base table, and in the base table, there is only the original language, so only migrates the original language.
Proposed resolution
Define the lancode with another alias, and change it from ids.