1

Even after changing the settings in /admin/config/system/site-information, the page title still contains "Drupal".

All external examinations of the site configuration (config table and exported files) show the new name.

I examined the function template_preprocess_html() in theme.inc (where the configuration value is supposed to be loaded and entered in the theme variables), and inserted the following var_dumps:

var_dump(\Drupal::config('system.site')->getRawData()['name']);
var_dump(\Drupal::config('system.site')->get('name'));
var_dump(\Drupal::config('system.site')->getOriginal('name'));

The resulting output is string(12) "My Site Name" string(6) "Drupal" string(6) "Drupal".

The configuration value isn't overridden anywhere in the site's settings files either. All caches are cleared.

Why is ->get('name') returning the wrong value even though ->getRawData() contains the correct one?

Edit: I should probably add that this is a site with a non-English default language. That seems to be the cause of nearly all the configuration-related core bugs. However, the langcode of the sytem.site configuration entity is correctly set.

Edit: More digging reveals that the language module is indeed responsible for overriding the configured name with the default name.

Edit3: There doesn't appear to be a way to set the localized site information without editing the configuration externally. I exported it, deleted the file language/de/system.site.yml and re-imported, which fixed it. (In the production site, importing didn't remove the deleted configuration entity; I had to delete the language.de/system.site record from the config table directly.)

0

The key to translating the configuration entities and objects is the core module config_translation (Configuration Translation).

This provides extra routes for every form that edits site settings or config entities, which allow editing the translations of translation-enabled config strings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.