- Issue created by @vikramsaini1609
- Merge request !12745Fixed: Path alias language doesn't changes on changing of node language → (Open) created by Unnamed author
- 🇮🇳India saiprasad_g
This patch resolves an issue where changing the language of an existing node causes the previously assigned path alias to disappear from the edit form. The root cause is that the alias remains tied to the original language code in the path_alias table, and Drupal does not automatically update it when the node’s language is changed. This results in a mismatch, making the alias effectively invisible or unusable for the new language. The patch adds logic in the Node::preSave() method to detect when the node's language has changed. If a change is detected, it generates a new alias with the updated language code and assigns it to the node's path field. Additionally, it stores the old and new languages to display a helpful message to the user after saving, indicating the alias has been updated. This ensures that the alias language remains synchronized with the node language, preventing confusion or routing issues in multilingual environments
The Needs Review Queue Bot → tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
- First commit to issue fork.
- Merge request !128403536218 - Path alias fix when language is changed → (Open) created by Unnamed author