54 · Block components get a new version on a translated site, and imported pages fail¶
| Project | Drupal Canvas (canvas) |
| Component | Code |
| Category | Bug report |
| Priority | Major |
| Status | Reported upstream as #3592155 |
Problem/Motivation¶
Canvas creates a component for every block plugin and stores the block's default settings in the versioned settings of that component. For a views block, the default label is the block plugin label, which Views builds from the view label and the display title, both translated into the site language. On a site installed in German, block.views_block.events-latest therefore gets the label "Veranstaltungen: Latest" instead of "Events: Latest", and with it a different version hash.
A site template exported on an English site refers to the English hash. On the German site the default content import stops:
/var/www/cms/./recipes/horizonaid/content/canvas_page/01-home.yml:
components.40.component_version='f0323c1d76b867d4' is not a version that exists
on component config entity 'block.views_block.events-latest'.
The installation of Horizon Aid finishes, but the home page and every page after it in the import are missing, and the front page returns 404.
The same happens to configuration that refers to a block component. With the web installer, Canvas creates the language switcher component (block.language_block.language_interface, default label "Sprachumschalter") before the Dashi recipe is applied, so the version Dashi ships never exists. Dashi's page variant – the header on every page – still refers to it, and every page returns 500:
OutOfRangeException: The requested version `fb2494ad75f77da6` is not available.
Available versions: `9cdcad8d1d9a30d5`, `7a32d186dcb9acf1`, `81e7902bd8035408`.
Installed with Drush, the shipped version survives as an older version, so the problem only shows with the web installer.
Config actions are affected as well. Varbase Starter and The Rightup create their search block component with createIfNotExists and then place it in the header with setProperties. With the web installer the component exists already, with the German label and another version, so createIfNotExists does nothing and the installation stops:
Drupal\Core\Recipe\InvalidConfigException: There were validation errors in
canvas.page_region.vartheme_bs5.header:
- component_tree.64cc6d33-….component_version: 'abd3c7419d413cec' is not a
version that exists on component config entity
'block.views_exposed_filter_block.search-block_1'.
Steps to reproduce¶
- Install Drupal CMS in German (or any language with a translation of "Events" and "Upcoming events") with the Horizon Aid site template.
- The installer reports the error above;
/returns 404. - Or: install Drupal CMS in German with Dashi through the web installer (
/core/install.php). After the installation every page returns 500. - Or: install Drupal CMS in German with Varbase or The Rightup through the web installer. The installation stops with the InvalidConfigException above.
Proposed resolution¶
Keep language-dependent values out of the version hash of block components – for example by computing the default label from the untranslated configuration, or by leaving the label out of the hashed settings, since every placed block sets its own label anyway.
Workaround: dcle points references to a version that does not exist at the active version of the block component – while default content is imported, in config actions on page variants, page regions, content templates and patterns before they are applied, and in that configuration after a recipe is applied. This is safe for block components because a page stores all of its block inputs, label included.
Additional information¶
Found with Canvas 1.12.0 on Drupal CMS 2.2.1 and 2.2.2, German installations of Horizon Aid (Drush) and Dashi, Varbase and The Rightup (web installer) (October 2026). Related to report 02, where translating sample texts of components changes their version.
Copy to drupal.org
Issue title:
Block components get a new version on a translated site, and imported pages fail
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>Canvas creates a component for every block plugin and stores the block's default settings in the versioned settings of that component. For a views block, the default label is the block plugin label, which Views builds from the view label and the display title, both translated into the site language. On a site installed in German, <code>block.views_block.events-latest</code> therefore gets the label "Veranstaltungen: Latest" instead of "Events: Latest", and with it a different version hash.</p>
<p>A site template exported on an English site refers to the English hash. On the German site the default content import stops:</p>
<code>/var/www/cms/./recipes/horizonaid/content/canvas_page/01-home.yml:
components.40.component_version='f0323c1d76b867d4' is not a version that exists
on component config entity 'block.views_block.events-latest'.</code>
<p>The installation of Horizon Aid finishes, but the home page and every page after it in the import are missing, and the front page returns 404.</p>
<p>The same happens to configuration that refers to a block component. With the web installer, Canvas creates the language switcher component (<code>block.language_block.language_interface</code>, default label "Sprachumschalter") before the Dashi recipe is applied, so the version Dashi ships never exists. Dashi's page variant – the header on every page – still refers to it, and every page returns 500:</p>
<code>OutOfRangeException: The requested version `fb2494ad75f77da6` is not available.
Available versions: `9cdcad8d1d9a30d5`, `7a32d186dcb9acf1`, `81e7902bd8035408`.</code>
<p>Installed with Drush, the shipped version survives as an older version, so the problem only shows with the web installer.</p>
<p>Config actions are affected as well. Varbase Starter and The Rightup create their search block component with <code>createIfNotExists</code> and then place it in the header with <code>setProperties</code>. With the web installer the component exists already, with the German label and another version, so <code>createIfNotExists</code> does nothing and the installation stops:</p>
<code>Drupal\Core\Recipe\InvalidConfigException: There were validation errors in
canvas.page_region.vartheme_bs5.header:
- component_tree.64cc6d33-….component_version: 'abd3c7419d413cec' is not a
version that exists on component config entity
'block.views_exposed_filter_block.search-block_1'.</code>
<h3 id="summary-steps-reproduce">Steps to reproduce</h3>
<ol>
<li>Install Drupal CMS in German (or any language with a translation of "Events" and "Upcoming events") with the Horizon Aid site template.</li>
<li>The installer reports the error above; <code>/</code> returns 404.</li>
<li>Or: install Drupal CMS in German with Dashi through the web installer (<code>/core/install.php</code>). After the installation every page returns 500.</li>
<li>Or: install Drupal CMS in German with Varbase or The Rightup through the web installer. The installation stops with the InvalidConfigException above.</li>
</ol>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Keep language-dependent values out of the version hash of block components – for example by computing the default label from the untranslated configuration, or by leaving the label out of the hashed settings, since every placed block sets its own label anyway.</p>
<p>Workaround: <a href="https://www.drupal.org/project/dcle">dcle</a> points references to a version that does not exist at the active version of the block component – while default content is imported, in config actions on page variants, page regions, content templates and patterns before they are applied, and in that configuration after a recipe is applied. This is safe for block components because a page stores all of its block inputs, label included.</p>
<h3>Additional information</h3>
<p>Found with Canvas 1.12.0 on Drupal CMS 2.2.1 and 2.2.2, German installations of Horizon Aid (Drush) and Dashi, Varbase and The Rightup (web installer) (October 2026). Related to <a href="https://project.pages.drupalcode.org/dcle/issues/02-canvas-translation-changes-component-version/">report 02</a>, where translating sample texts of components changes their version.</p>