Problem/Motivation
1. If a multilingual support is disabled for a content type, there is no language_content_type variable for this content type. When d7_language_content_settings migration is executed, we get this warning:
No static mapping found for 'NULL' and no default value provided for destination 'default_langcode'.
2. If a content type is translatable with entity_translation, we get this message:
No static mapping found for ''4'' and no default value provided for destination 'default_langcode'.
Proposed resolution
Add a mapping for '4' (entity_translation) and make sure we don't get NULL values.
Remaining tasks
Write the patch
- Review
- Commit
User interface changes
None.
API changes
None.
Data model changes
None.
Comments
Comment #2
maxocub commentedHere's a failing patch and the fix.
Comment #5
maxocub commentedFixed the failing test.
Comment #7
heddnBy changing this, all folks will silently start working with a default of 0 if they also don't update their yaml. Because it will have a default value of 0. And they might start pulling out their hair trying to figure out why 4 or any value but 0-3 just defaults to NULL. This probably deserves a change record.
Comment #8
maxocub commentedOh right. Instead of modifying the source plugin, we can also add a default value to the migration yaml. This also fix the problem without affecting people using the source plugin.
Comment #11
masipila commentedI reviewed and tested this manually.
Test results without patch #8
I'm able to reproduce the issue by having a content type which does not have multilingual options enabled and by having another content type which has Entity Translation enabled. (I updated the Issue Summary to better describe the scenario where this bug is triggered.)
Manual test results with patch #8 applied
No warnings are logged and migration results are as expected.
Conclusion
Comment #12
alexpottAdding credit
Comment #13
alexpottCommitted and pushed a42433ef91 to 8.7.x and c34c4408de to 8.6.x. Thanks!
Comment #16
alexpottBackported to 8.6.x since this is a migrate drupal fix and that is stable only in 8.6.0