Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
The Drupal 7 synchronized fields need a migration. This should be same, or very similar to the Drupal 6 version. See #2754493: D6 synchronized field settings aren't migrated properly
Proposed resolution
Turn "synchronized fields" into untranslated fields in the D8 content translation settings.
Comment | File | Size | Author |
---|---|---|---|
#20 | interdiff-18-20.txt | 1.39 KB | quietone |
#20 | 3031727-20.patch | 8.67 KB | quietone |
#18 | 3031727-18.patch | 9.77 KB | quietone |
#18 | diff-16-18.txt | 1.32 KB | quietone |
#16 | 3031727-16.patch | 9.78 KB | quietone |
Comments
Comment #2
quietone CreditAttribution: quietone at Acro Commerce commentedCan't add a synchronized field to the test fixture. When I add the field and click save the results is "An illegal choice has been detected.". It has something to do with the inability to set the 'default parent item' in the menu settings of the content type. This happens for all content types. I've asked on slack about this and so far no response.
Comment #4
quietone CreditAttribution: quietone at Acro Commerce commentedComment #5
quietone CreditAttribution: quietone as a volunteer commentedNo longer postponed
Comment #6
quietone CreditAttribution: quietone as a volunteer commentedAnd finally a patch.
Comment #8
quietone CreditAttribution: quietone as a volunteer commentedIgnore previous patch. This is the right one.
Comment #9
Gábor HojtsyThe test looks good. Are we sure the syncronized fields get the value from the right place? (In practice default translation in my understanding.) That is not really covered here.
Comment #10
quietone CreditAttribution: quietone as a volunteer commentedSetting to NW for the question in #10
Comment #11
quietone CreditAttribution: quietone as a volunteer commentedYes, the value is only stored in the field table. Nothing is stored in locales_target or the i18n_string table. I checked by bringing up a d7 site with this fixture (from this patch), changed the field value for the english node and checked the tables. Repeated the same for the icelandic translation, with the same result. Finally, dumped the fixture and grepped for the field value. As I recall, this is the same behaviour I found with d6 synchronized fields.
This patch just enables i18n_sync in the source.
Comment #12
Gábor HojtsyOk looking closer I can see the test actually proves this as well :) Yay! Looks all good to me.
Comment #14
quietone CreditAttribution: quietone as a volunteer commentedNeeded a reroll plus fix the Upgrade7Test. No interdiff because of the reroll. The fix was to add an entry in core/modules/field/migrations/state/field.migrate_drupal.yml for i18n_sync module.
Comment #16
quietone CreditAttribution: quietone as a volunteer commentedFixing the test.
Comment #17
Gábor HojtsyI like issues with a limited scope and straightforward implementation. Thanks for the reroll! :)
Comment #18
quietone CreditAttribution: quietone as a volunteer commentedNeeded a reroll
Comment #19
Gábor HojtsyWhat is this new empty string meant to help with? It definitely does not align with coding standards and looks like a mistake.
Comment #20
quietone CreditAttribution: quietone as a volunteer commentedGood eye. Don't know how that crept in but the trailing empty string is removed.
Comment #21
Gábor HojtsyLooks good again, thanks for the reroll.
Comment #22
alexpottCommitted b2e2c03 and pushed to 8.8.x. Thanks!
The code look correct and has test coverage. Nice work.