Problem/Motivation

  • The Rightup recipe sets the front page to the alias /home (page.front: /home), and its default content pins every path alias to English (path: - alias: ..., langcode: en).
  • During a non-English install, core's default content importer moves each content entity to the site's default language (Importer::verifyNormalizedLanguage()), but PathItem::postSave() keeps the explicit langcode: en. The aliases stay English while the pages do not.
  • Drupal looks aliases up in the current language, so /home does not resolve: the front page and every page reached by alias return 404.
  • Same bug as Horizon Aid #3629922 (MR !119), reproduced there with a Portuguese (pt-pt) install: home 404 without the fix, 200 with it.
  • An installed copy of this recipe has 265 pinned aliases. The MR will report the count on the current 1.0.x HEAD.

Steps to reproduce

  1. Install Drupal CMS and pick The Rightup site template, or run drush site:install drupal_cms_installer installer_site_template_form.add_ons=rightup --locale=pt-pt
  2. Choose Portuguese (or any non-English language) as the default language.
  3. Open the home page: "Page not found".
  4. Repeat in English: the home page renders.

Proposed resolution

  • Remove the pinned langcode from the path items in the recipe's default content, so each alias follows its entity's language. English installs are unchanged.

Remaining tasks

  • ✅ File an issue
  • ❌ Addition/Change/Update/Fix
  • ❌ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support
  • ➖ User Guide Documentation support
  • ➖ UX/UI designer responsibilities
  • ➖ Accessibility and Readability
  • ❌ Reviewed by a human
  • ❌ Code review by maintainers
  • ❌ Full testing and approval
  • ❌ Credit contributors
  • ❌ Review with the product owner
  • ✅ Update Release Notes
  • ✅ Release rightup-1.0.9

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • Fixed the home page returning 404 when the site is installed in a language other than English.

Issue fork rightup-3636517

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

rajab natshah created an issue. See original summary.

  • rajab natshah committed 1b53a555 on 1.0.x
    fix: #3636517 Home page not found when the default language is not...

  • rajab natshah committed 02a99796 on 1.0.x
    fix: #3636517 Confirm the contact form inline so submitting no longer...
xpete’s picture

I've run into this error while trying to test this:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: http://drupal.local/core/install.php?rewrite=ok&langcode=pt-pt&profile=d...
StatusText: OK
ResponseText: Drupal\Core\Recipe\InvalidConfigException: There were validation errors in canvas.page_region.vartheme_bs5_rightup.header:
- component_tree.c2b92c2a-fc11-419a-aefd-568d24395328.component_version: '7bcf8ab13aa5d5d0' is not a version that exists on component config entity 'block.views_exposed_filter_block.search-header_search'. Available versions: 'b1d336d64a5ddf78'.
- component_tree.e9e7b7b4-05df-4861-8ca6-983df67fdf38.component_version: '7bcf8ab13aa5d5d0' is not a version that exists on component config entity 'block.views_exposed_filter_block.search-header_search'. Available versions: 'b1d336d64a5ddf78'. in Drupal\Core\Config\Action\ConfigActionManager->applyAction() (line 179 of /home/username/public_html/drupalcms2/web/core/lib/Drupal/Core/Config/Action/ConfigActionManager.php).

Maybe the version should not be specified.

rajab natshah’s picture

Status: Active » Needs review

Thank you @xpete for testing and reporting.

Reproduced on Drupal CMS 2 with Português (Portugal).

Cause: Drupal Canvas versions a block component with a hash that includes the translated block label. On a non-English install the version is not the English one the recipe asks for, so the install stops. It depends on timing, so it can show on the header search block or on the breadcrumb block.

Fix in MR !100: keep the English version of each of these block components, beside the one Canvas made.

✅ Português (Portugal) install finishes. Home, News, Podcasts and Search pages open.
✅ English install not changed.
✅ All CI jobs passed.

The home page not found fix is already merged in 1.0.x. It will be in the next release.

The same install problem is in Varbase Starter, Educare and Horizon Aid. Following up on them.

Needs review.

  • rajab natshah committed 8736791e on 1.0.x
    fix: #3636517 Keep the English block component versions so a non-English...
xpete’s picture

I also tested "Horizon Aid" and it doesn't have the component version error. I verified the "Horizon Aid" recipe file and the version is not specified there so I guess that you just need to change Varbase Starter, Educare and Rightup to mach what is on "Horizon Aid".

rajab natshah’s picture

Thank you @xpete for testing Horizon Aid too.

Horizon Aid has the same pinned versions. Its recipe.yml sets component_version: 0d7e961dd03aa710 for block.system_breadcrumb_block in the blog, program and event templates.

It installed for me in Português (Portugal) too. That run Canvas made the breadcrumb component after the recipe, so the English version was there. It depends on timing, the same as in The Rightup.

The fix from MR !100 is merged in 1.0.x, and it will be in The Rightup 1.0.9.
Doing the same for Varbase Starter, Educare and Horizon Aid.

Will check with Drupal Canvas if the version can be left out, as you suggested.

rajab natshah’s picture

Issue summary: View changes
Status: Needs review » Fixed
Issue tags: +rightup-1.0.9

✅ Released in rightup 1.0.9

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.