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 on system_maintenance
  • d*_system_site_translation should depend on system_site
  • d*_user_mail_translation should depend on d*_user_mail
  • d7_user_settings_translation should depend on user_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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

huzooka created an issue. See original summary.

huzooka’s picture

Assigned: huzooka » Unassigned
Status: Active » Needs work
FileSize
2.04 KB

This patch depends on an (obsolete) fix posted at #3187320-2: Migrate Drupal 7 user settings and only fixes Drupal 7 migration plugin definitions.

Wim Leers’s picture

Title: Module settings translation migrations should depend on the default settings migration » [PP-1] Module settings translation migrations should depend on the default settings migration
Status: Needs work » Postponed
Issue tags: +D8MI
Related issues: +#3187320: Migrate Drupal 7 user settings

This patch looks great — but indeed is blocked on that other patch getting rerolled, and then changing

+    - user_settings

to

+    - d7_user_settings
Wim Leers’s picture

huzooka’s picture

Status: Postponed » Active
huzooka’s picture

Title: [PP-1] Module settings translation migrations should depend on the default settings migration » Module settings translation migrations should depend on the default settings migration
Wim Leers’s picture

Status: Active » Needs review

Queued tests.

/me nudges @huzooka to go back to being on vacation 🤓

quietone’s picture

Can 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.

quietone’s picture

Status: Needs review » Needs work

Actually, 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.

huzooka’s picture

Issue tags: +Novice
Shashwat Purav’s picture

Status: Needs work » Needs review
FileSize
2.06 KB
4.12 KB

Added a patch and interdiff file.

Status: Needs review » Needs work

The last submitted patch, 11: 3187415-11.patch, failed testing. View results

quietone’s picture

@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.

Shashwat Purav’s picture

Status: Needs work » Needs review
FileSize
1.5 KB
5.62 KB

Added a patch and interdiff file for the changes suggested in #13

Status: Needs review » Needs work

The last submitted patch, 14: 3187415-14.patch, failed testing. View results

Shashwat Purav’s picture

Status: Needs work » Needs review
FileSize
2.9 KB
8.51 KB

Added a patch and interdiff file for the changes suggested in #13

Status: Needs review » Needs work

The last submitted patch, 16: 3187415-16.patch, failed testing. View results

quietone’s picture

+++ b/core/modules/config_translation/migrations/d6_system_site_translation.yml
@@ -40,3 +40,6 @@ destination:
+migration_dependencies:
...
+    - system_site

+++ b/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateSystemSiteTranslationTest.php
@@ -21,6 +21,7 @@ class MigrateSystemSiteTranslationTest extends MigrateDrupal6TestBase {
+    $this->executeMigration('system_maintenance');

Not 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,

+migration_dependencies:
		+  required:
		+    - system_site

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

anmolgoyal74’s picture

anmolgoyal74’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 19: 3187415-19.patch, failed testing. View results

anmolgoyal74’s picture

Status: Needs work » Needs review
FileSize
8.53 KB
1.37 KB
quietone’s picture

Status: Needs review » Needs work

Great. tests are passing!

One more thing I only just noticed.

+++ b/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserConfigsTranslationTest.php
@@ -27,6 +27,7 @@ protected function setUp(): void {
+    $this->executeMigrations(['d6_user_mail', 'd6_user_settings']);
     $this->executeMigrations(['d6_user_mail_translation', 'd6_user_settings_translation']);

+++ b/core/modules/config_translation/tests/src/Kernel/Migrate/d7/MigrateUserConfigsTranslationTest.php
@@ -33,6 +33,7 @@ protected function setUp(): void {
+    $this->executeMigrations(['d7_user_mail', 'd7_user_settings']);

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.

Shashwat Purav’s picture

Status: Needs work » Needs review
FileSize
1.7 KB
8.57 KB

Added a patch and interdiff file for the changes suggested in #23

anmolgoyal74’s picture

I think we should array elements into their own line in core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserConfigsTranslationTest.php

quietone’s picture

Status: Needs review » Needs work
+++ b/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserConfigsTranslationTest.php
@@ -27,7 +27,7 @@ protected function setUp(): void {
+    $this->executeMigrations(['d6_user_mail', 'd6_user_settings', 'd6_user_mail_translation', 'd6_user_settings_translation']);

The 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.

abhisekmazumdar’s picture

Status: Needs work » Needs review
FileSize
8.8 KB
1.12 KB

Made the suggested changes from #26. Kindly Review

quietone’s picture

Status: Needs review » Needs work

@abhisekmazumdar, thanks.

Just two changes left to do.

  1. +++ b/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserConfigsTranslationTest.php
    @@ -25,9 +25,17 @@ class MigrateUserConfigsTranslationTest extends MigrateDrupal6TestBase {
    -    $this->installSchema('locale',
    -      ['locales_source', 'locales_target', 'locales_location']);
    -    $this->executeMigrations(['d6_user_mail_translation', 'd6_user_settings_translation']);
    +    $this->installSchema('locale', [
    +      'locales_source',
    +      'locales_target',
    +      'locales_location'
    +    ]);
    

    This change is out of scope, it needs to be reverted.

  2. +++ b/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserConfigsTranslationTest.php
    @@ -25,9 +25,17 @@ class MigrateUserConfigsTranslationTest extends MigrateDrupal6TestBase {
    +      'd6_user_settings_translation'
    

    Missing trailing comma. 'd6_user_settings_translation',

abhisekmazumdar’s picture

Status: Needs work » Needs review
FileSize
8.55 KB
1.03 KB

Thanks, @quietone for the suggestion.

abhisekmazumdar’s picture

Kindly ignore the patch on #29

The last submitted patch, 29: 3187415-29.patch, failed testing. View results

quietone’s picture

Status: Needs review » Reviewed & tested by the community

@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.

alexpott’s picture

Version: 9.2.x-dev » 9.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 5425271050 to 9.2.x and b2ff38ca14 to 9.1.x. Thanks!

  • alexpott committed 5425271 on 9.2.x
    Issue #3187415 by Shashwat Purav, abhisekmazumdar, anmolgoyal74, Wim...

  • alexpott committed b2ff38c on 9.1.x
    Issue #3187415 by Shashwat Purav, abhisekmazumdar, anmolgoyal74, Wim...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.