Configuration translation uses default language on domain-enabled config forms

Created on 31 May 2024, 27 days ago
Updated 26 June 2024, 1 day ago

Drupal Version

10.2.6

Domain module version

2.0.0-beta1

Expected Behavior

Using a configuration translation form should get and save values for the selected language.

Actual Behavior

Configuration translation forms use values from the default site language when editing translations. Translations do not save.

Steps to reproduce

  1. Create and install a new Drupal site with composer, drush si, and default settings.
  2. Require the Domain module: composer install drupal/domain.
  3. Enable modules: drush en config_translation domain_config_ui language.
  4. Visit /admin/config/regional/language and add Spanish as a second language.
  5. Visit /admin/config/domain and configure two domain records.
  6. Visit /admin/config/system/site-information and configure a site title for all domains and languages. (Note that this is the Domain Configuration UI and is working as expected!)
  7. Visit /admin/config/system/site-information/translate and edit the Spanish translation. The values for English are displayed and will not save for Spanish.

Perhaps this is not a valid use case. However, be aware that some modules do not expose all configuration values in the main form. These must be edited from the configuration translation form for that module. For example, see the External Links β†’ module:

  1. Require the External Links module: composer require drupal/extlink.
  2. Enable the module: drush en extlink.
  3. Visit /admin/config/user-interface/extlink, enable domain configuration, and save values for each domain.
  4. Visit /admin/config/user-interface/extlink/translate and try to add a Spanish translation. The values are not retrieved or saved.

I didn't get far with Xdebug, but my first suspect is DomainConfigOverrider. Here the language manager was returning the site default language for me, rather than the actual language of the request.

πŸ› Bug report
Status

Active

Version

2.0

Component

- Domain Config

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024