Problem/Motivation
Whenever a translated property has the same value which is the default property value on the destination site, the language override (which is the actual configuration translation) won't store this property, because it is equal to the original configuration's property. If the "default" configuration gets migrated after its translation, it might contain different value for this property, so in this case, the migrated language override won't be the same as expected.
Proposed resolution
Make module settings translation migrations depend on the corresponding default settings migration:
d*_system_maintenance_translation
should depend onsystem_maintenance
d*_system_site_translation
should depend onsystem_site
d*_user_mail_translation
should depend ond*_user_mail
d7_user_settings_translation
should depend onuser_settings
d7_user_settings
, see #3187320-4: Migrate Drupal 7 user settings
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#30 | interdiff.3187415.29-30.txt | 775 bytes | abhisekmazumdar |
#30 | 3187415-30.patch | 8.6 KB | abhisekmazumdar |
#29 | interdiff.3187415.27-29.txt | 1.03 KB | abhisekmazumdar |
#29 | 3187415-29.patch | 8.55 KB | abhisekmazumdar |
#27 | interdiff.3187415.24-27.txt | 1.12 KB | abhisekmazumdar |
Comments
Comment #2
huzookaThis patch depends on an (obsolete) fix posted at #3187320-2: Migrate Drupal 7 user settings and only fixes Drupal 7 migration plugin definitions.
Comment #3
Wim LeersThis patch looks great — but indeed is blocked on that other patch getting rerolled, and then changing
to
Comment #4
Wim LeersRerolled #2 on top of #3187320-9: Migrate Drupal 7 user settings.
Comment #5
huzookaComment #6
huzookaComment #7
Wim LeersQueued tests.
/me nudges @huzooka to go back to being on vacation 🤓
Comment #8
quietone CreditAttribution: quietone as a volunteer commentedCan you confirm there are no other migrations that need to be modified?
I think for completeness I'll add the d6 versions as well, sometime this week I hope.
Comment #9
quietone CreditAttribution: quietone as a volunteer commentedActually, I'll not do the d6 ones. I'd rather stay as a reviewer on this.
Setting NW to update the failing tests to execute the dependent migrations.
Comment #10
huzookaComment #11
Shashwat Purav CreditAttribution: Shashwat Purav at QED42 for Drupal Association commentedAdded a patch and interdiff file.
Comment #13
quietone CreditAttribution: quietone as a volunteer commented@Shashwat Purav, thanks.
To fix the failing tests, the dependent migration must be explicitly run in the Kernel test. For example for d6\MigrateSystemMaintenanceTranslationTest the 'system_maintenance' migration needs to run first. So, add this
$this->executeMigration('system_maintenance');
just before
$this->executeMigration('d6_system_maintenance_translation');
And similar for the other failing tests.
Thanks.
Comment #14
Shashwat Purav CreditAttribution: Shashwat Purav at QED42 for Drupal Association commentedAdded a patch and interdiff file for the changes suggested in #13
Comment #16
Shashwat Purav CreditAttribution: Shashwat Purav at QED42 for Drupal Association commentedAdded a patch and interdiff file for the changes suggested in #13
Comment #18
quietone CreditAttribution: quietone as a volunteer commentedNot quite, the 'd6_system_site_translation' migration is not dependent on the 'system_maintenance' migration. To find what it is dependent on, look at the changes made to d6_system_site_translation.yml in this patch. That is,
Which means the dependency is the 'system_site' migration. For this test, change 'system_maintenance' to system_site and it should pass. You can test that locally and not rely on the test bot and waiting an hour for the report. Running PHPUnit tests. The same process can be used to find the dependency to add for the other tests.
Cheers
Comment #19
anmolgoyal74 CreditAttribution: anmolgoyal74 at OpenSense Labs for DrupalFit commentedComment #20
anmolgoyal74 CreditAttribution: anmolgoyal74 at OpenSense Labs for DrupalFit commentedComment #22
anmolgoyal74 CreditAttribution: anmolgoyal74 at OpenSense Labs for DrupalFit commentedComment #23
quietone CreditAttribution: quietone as a volunteer commentedGreat. tests are passing!
One more thing I only just noticed.
Since these two tests are already using executeMigrations then it will be easier to read if we add the two new migrations to the array. the array will need to be reformatted.
Comment #24
Shashwat Purav CreditAttribution: Shashwat Purav at QED42 for Drupal Association commentedAdded a patch and interdiff file for the changes suggested in #23
Comment #25
anmolgoyal74 CreditAttribution: anmolgoyal74 at OpenSense Labs for DrupalFit commentedI think we should array elements into their own line in
core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserConfigsTranslationTest.php
Comment #26
quietone CreditAttribution: quietone as a volunteer commentedThe formatting of the array on this line should match what was done for d7/MigrateUserConfigsTranslationTest.php. That will keep the line under 80 char and make it easier to read.
Comment #27
abhisekmazumdarMade the suggested changes from #26. Kindly Review
Comment #28
quietone CreditAttribution: quietone as a volunteer commented@abhisekmazumdar, thanks.
Just two changes left to do.
This change is out of scope, it needs to be reverted.
Missing trailing comma.
'd6_user_settings_translation',
Comment #29
abhisekmazumdarThanks, @quietone for the suggestion.
Comment #30
abhisekmazumdarKindly ignore the patch on #29
Comment #32
quietone CreditAttribution: quietone as a volunteer commented@abhisekmazumdar, thank you.
I reviewed the patch and it resolves the problem in the IS. If anyone wonders, there is no need to convert the use of 'executeMigration' to 'executeMigrations' because executeMigrations is only needed for migrations that have a deriver. These migrations do not.
Comment #33
alexpottCommitted and pushed 5425271050 to 9.2.x and b2ff38ca14 to 9.1.x. Thanks!