Problem/Motivation

When installing modules or themes, locale module adds a batch to rewrite the configuration added for language and also apply configuration overrides based on locale data. This is theoretically consistent between module and theme install but theme install goes through a regular link/controller instead of a form and never executes the batch locale adds.

Ironically this works for experimental themes because they get a confirm form which does then execute the batch.

While locale's updateDefaultConfigLangcodes() batch is queued by hook_themes_installed it is never executed. The ThemeController::install() action performs the install and then immediately returns a RedirectResponse to system.themes_page — without ever calling batch_process(). As a result, all theme config langcodes remain exactly as shipped regardless of the site default language.

Steps to reproduce

1. Have locale module enabled and a non-English site default language.
2. Manually add a YAML file for a content type to the default_admin theme in core (not installed yet).
3. Install the theme, submit the confirm form.
4. Check in config export that it worked, the config is in the non-English language.

On the other hand, do the same for a non-experimental theme, and the config will not be in the language you expect.

Proposed resolution

Either check for a queued batch in ThemeController::install() after calling $this->themeInstaller->install(), and call batch_process() if one exists, the same way FormSubmitter::doSubmitForm() does or consider moving theme install to a proper form submission so the standard batch-processing path handles it automatically.

Remaining tasks

User interface changes

If we go with the form method, the "install" and "install and set default" features will become a button to submit the form.

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3612163

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

gábor hojtsy created an issue. See original summary.

gábor hojtsy’s picture

Issue summary: View changes