Problem/Motivation
This D7 migration has been move out of #2981393: Migrate D6 comment type language settings because the D7 fixture is broken and needs to be fixed before work continues.
In #2981392: Comment migration corrupts data with multilingual sites we found out that the comment type language settings are not migrated sensibly when the source content type has multilingual support enabled.
Migrations generate one comment type for each Drupal 7 content type (except Forum which uses the hard coded comment_forum). The D8 comment type has a default language for new comments, see the screenshot below.
Currently we leave the default language (for new comments created in D8) to site default language. We also do not show the language selector for comments so that users could change the comment language when they are creating / editing the comments.
Proposed resolution
1. If the Drupal 7 content type has multilingual support 'disabled'.
Drupal 7 fixture: book.
- 'Default language' setting of the comment type: 'Site default'.
- 'Show language selector' setting of the comment type: disabled.
- 'Enable translation' setting of the comment type: disabled.
2. If the Drupal 7 content type has multilingual support 'enabled'.
Drupal 7 fixture: Page.
This means that the nodes can have a language code but the different nodes cannot be linked as translations of each other.
- 'Default language': 'Interface text language selected for page' instead of 'Site default'.
- 'Show language selector': enabled. This way the D8 user can see what the language of the new comments will be.
- 'Enable translation': disabled. This is because the comments in D7 are independent i.e. the comments are not translations of each other.
3. If the Drupal 7 content type has multilingual support 'Enabled, with translation'.
Drupal 7 fixture: article and blog.
This means that the nodes can have a language code and the nodes with different language codes can be linked as translations of each other. The different node language versions will have their independent comments i.e. the comments are not translations of each other.
- 'Default language': 'Interface text language selected for page' instead of 'Site default'.
- 'Show language selector': enabled. This way the D8 user can see what the language of the new comments will be.
- 'Enable translation': disabled. This is because the comments in D7 are independent i.e. the comments are not translations of each other.
4. If the Drupal 7 content type has multilingual support as 'Enabled, with field translation'.
Drupal 7 fixture: test_content_type.
- 'Default language': 'Interface text language selected for page' instead of 'Site default'.
- 'Show language selector': enabled. This way the D8 user can see what the language of the new comments will be.
- 'Enable translation': Depends on the Entity Translation settings in Drupal 7 (admin/config/regional/entity_translation).
- If the 'Translatable Entity Types' include Comments, then it means that actual comments entities can be translated and D8 'Enable translation' should be enabled.
- If the 'Translatable Entity Types' does NOT include Comments, then it means that actual comments entities can NOT be translated and D8 'Enable translation' should be disabled.
- Reference: The Entity Translation settings were originally handled in #2073467: Migrate Drupal 7 Entity Translation settings to Drupal 8. I'm not sure if this variation was included in that issue.
Remaining tasks
1. Patch
2. Review and test
3. Commit
User interface changes
Enables the comment language selector + changes the default comment language for multilingual sites.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#15 | 3024460-15.patch | 16.4 KB | quietone |
#15 | interdiff-reroll-15.txt | 1.32 KB | quietone |
#9 | interdiff-8-9.txt | 9.23 KB | quietone |
#9 | 3024460-9-fail.patch | 16.68 KB | quietone |
#9 | 3024460-9.patch | 16.77 KB | quietone |
Comments
Comment #2
quietone CreditAttribution: quietone as a volunteer commentedThis is D7 part of the patch from 2981393.#59
Removed references to D6 in the IS, that should be sufficient
Comment #4
quietone CreditAttribution: quietone as a volunteer commentedReroll
Comment #5
masipila CreditAttribution: masipila as a volunteer commentedI tested path #4 manually.
1. Content type with multilingual settings 'disabled': All three language settings are according to the IS.
2. Content type with multilingual settings 'enabled': All three language settings are according to the IS.
3. Content type with multilingual settings 'enabled, with translation': All three language settings are according to the IS.
4. Content type with multilingual settings 'enabled, with field translation' i.e. Entity Translation
5. Other review comments for the patch.
Should be 'Tests migration of comment language settings.'
6. When testing this issue, I got the following migration error:
I re-ran my D7 migration also without the latest patch applied (i.e. current 8.7.x) and as I expected, this error was not caused by this patch. Does this ring a bell to anyone and do we already have an issue opened to address this error?
Cheers,
Markus
Comment #6
quietone CreditAttribution: quietone as a volunteer commented5.6. This is a recent bug. It was first reported by jhodgson first reported it in 2859297 Comment 46. Fortunately, it is an easy fix and the patch is ready for review in #3035259: Unknown column 'lt.i18n_status' in 'field list'.
Comment #8
quietone CreditAttribution: quietone as a volunteer commentedNeeds a reroll
Comment #9
quietone CreditAttribution: quietone as a volunteer commentedThe new process plugin ContentTranslationEnabledSetting.php wasn't getting the correct value for entity translation mode. That is corrected now by testing for empty instead of array_key_exists. This includes a new test, with a terribly long name, that uses MigrateDumpAlter to change the variable entity_translation_entity_types so that comment type is disabled. There is a fail patch showing the problem.
And the migration has moved to content translation module because of a discussion in the d6 version of this migration, #2981393: Migrate D6 comment type language settings. See comment 80.
Comment #11
quietone CreditAttribution: quietone as a volunteer commentedIt is the fail patch that failed, setting to NR
Comment #12
heddnAlmost there.
I commented in another issue about this. This should be removed. I think.
Still needs addressed from earlier (#5.5).
Comment #13
quietone CreditAttribution: quietone as a volunteer commentedComment #14
quietone CreditAttribution: quietone as a volunteer commentedComment #15
quietone CreditAttribution: quietone as a volunteer commentedRerolled the patch since #3022137: Update migrate fixtures for remaining active issues was committed and then, since they are small changes, made the fixes per #12.
Comment #16
Gábor HojtsyThanks for working on this. This looks good to me other than naming things :D
These are about "Drupal 7 comment language settings" no? Language of comments. "Content" is superfluous as you can only comment on content.
Same for the ID, it would be "d7_comment_language_settings" or somesuch no? Or does that need to follow naming pattern of d7_language_...? (If so, then keep the ID as is IMHO).
Comment #17
Gábor HojtsyHm I see these naming schemes are just consistent with the previously created #2981393: Migrate D6 comment type language settings so this should be fine as-is.
Comment #18
alexpottCommitted and pushed f3216900b1 to 8.8.x and 17c9135b8e to 8.7.x. Thanks!