Problem/Motivation

If you install Drupal from configuration you expect a site with configuration exactly as it is in the source configuration however one of the final steps of the installer - install_finish_translations() results in config translations being updated. This is unexpected.

Steps to reproduce

  1. Install Drupal in German minimal install
  2. Change the role name from Angemeldeter Benutzer to TEST!!! Angemeldeter Benutzer on admin/people/roles/manage/authenticated
  3. Export configuration (using drush is simplest)
  4. Drop the database and create the database
  5. Visit the installer and install from configuration

=> The role name is Angemeldeter Benutzer and there is a configuration to import if you do drush cim

Proposed resolution

Only run install_finish_translations() when not installing from configuration

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
StatusFileSize
new789 bytes

I think this patch is enough to disable the config translation updates. We need a test and good steps to reproduce the issue.

alexpott’s picture

Issue summary: View changes
alexpott’s picture

Issue summary: View changes

So the patch in #2 fixes the immediate problem but then when you install another module on the site it reverts the role name to Angemeldeter Benutzer so it is not a complete fix.

maacl’s picture

@alexpott I think maybe this is a duplicate of, or at least related to #2806009: Installing a module causes translations to be overwritten.

alexpott’s picture

@maacl - I agree it is related but unfortunately it is not the same. This is being caused by how \Drupal\locale\LocaleConfigSubscriber::onConfigSave() is not triggered during a site install (note this is NOT a module install).

I think the solution is to trigger the install_config_revert_install_changes task after the install_finish_translations task and ensure that \Drupal\locale\LocaleConfigSubscriber::onConfigSave() triggers correctly while install_config_revert_install_changes is running.

alexpott’s picture

StatusFileSize
new14.15 KB

Here's a test only patch.

alexpott’s picture

StatusFileSize
new2.44 KB
new15.4 KB

Here's the first bit of the fix the makes the configuration correct after config install - but we still need to register the customisations. Other (as this test shows) installing a module will result in them being reverted.

The last submitted patch, 7: 3169756-2-7.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 8: 3169756-2-8.patch, failed testing. View results

alexpott’s picture

Status: Needs work » Needs review
StatusFileSize
new4.38 KB
new18.53 KB

I think this fixes the problem.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

alexpott’s picture

I think I might be trying to fix the same bug in two different issues - see #2925203: LocaleConfigSubscriber can result in data loss during install

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

catch’s picture

Status: Needs review » Closed (duplicate)