15 · Recipe forces English as site language – content ends up in a language the site does not have¶
| Project | Convivial Gov (site template) |
| Component | Recipe |
| Category | Bug report |
| Priority | Major |
| Status | Reported upstream as #3582422 |
Problem/Motivation¶
recipe.yml contains a config action on system.site:
simpleConfigUpdate: { langcode: en, default_langcode: en, … }
On a German installation the site is temporarily English during the content import, so all content is saved as en. At the end, the Drupal CMS installer sets German as default again and removes English → content in a language that does not exist on the site (node_field_data: en/1=14, languages: only de).
Steps to reproduce¶
- Install Drupal CMS in German with Convivial Gov.
SELECT langcode, COUNT(*) FROM node_field_data GROUP BY langcode→ 14 ×en, while the only language isde.
Proposed resolution¶
Remove langcode/default_langcode from the config action. A recipe should not set the site language; Drupal CMS decides it from the template (SiteTemplate::getDefaultLangcode()).
Additional information¶
Workaround in the German Drupal CMS installer (restores the site language before the content import).
Copy to drupal.org
Issue title:
Recipe forces English as site language – content ends up in a language the site does not have
Issue summary (paste it into the "Issue summary" field; project, component, category and priority are in the table above):
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p><code>recipe.yml</code> contains a config action on <code>system.site</code>:</p>
<code>simpleConfigUpdate: { langcode: en, default_langcode: en, … }</code>
<p>On a German installation the site is temporarily English during the content import, so all content is saved as <code>en</code>. At the end, the Drupal CMS installer sets German as default again and removes English → content in a language that does not exist on the site (<code>node_field_data</code>: <code>en/1=14</code>, languages: only <code>de</code>).</p>
<h3 id="summary-steps-reproduce">Steps to reproduce</h3>
<ol>
<li>Install Drupal CMS in German with Convivial Gov.</li>
<li><code>SELECT langcode, COUNT(*) FROM node_field_data GROUP BY langcode</code> → 14 × <code>en</code>, while the only language is <code>de</code>.</li>
</ol>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Remove <code>langcode</code>/<code>default_langcode</code> from the config action. A recipe should not set the site language; Drupal CMS decides it from the template (<code>SiteTemplate::getDefaultLangcode()</code>).</p>
<h3>Additional information</h3>
<p>Workaround in the German Drupal CMS installer (restores the site language before the content import).</p>