fix: #3629922 Home page not found when the default language is not English

Issue: https://www.drupal.org/i/3629922

Problem

recipe.yml sets the front page to the alias /home, and every default content file pins its alias to langcode: en. On a non-English install the default content importer moves each entity to the site language (Importer::verifyNormalizedLanguage() in core/lib/Drupal/Core/DefaultContent/Importer.php), but PathItem::postSave() in core/modules/path/src/Plugin/Field/FieldType/PathItem.php keeps an explicit alias langcode. The aliases stay en, so /home does not resolve in Portuguese and the front page is a 404. Same for every other alias and the menu links that point at them.

Proposed resolution

Drop the pinned langcode from the path field in 177 files under content/, so each alias takes its entity's language. Nothing else changes. An English install still gets English aliases.

How to test

  1. Install Drupal CMS with the Horizon Aid template and Portuguese as the default language.
  2. Open /: the home page shows. Open /about, /donate and the main menu links: no 404.
  3. Repeat in English: unchanged.

Remaining tasks

  • Test on a real Portuguese install (so far verified by reading core and an alias lookup on an English site only).
  • drush content:export writes langcode on path items, so a future re-export can bring the pin back. Check exported content for it.

Reported by xpete.

AI-Generated: Yes

Checkpoints:

  • File an issue
  • Addition/Change/Update/Fix
  • Testing to ensure no regression
  • Automated unit testing coverage
  • Automated functional testing coverage
  • UX/UI designer responsibilities
  • Readability
  • Accessibility
  • Performance
  • Security
  • Developer Documentation
  • User Guide Documentation
  • Reviewed by human
  • Code review by maintainers
  • Full testing and approval
  • Credit contributors
  • Review with the product owner
  • Release notes snippet
  • Release
Edited by Rajab Natshah

Merge request reports

Loading
Loading