Problem/Motivation
In a multilingual context, where the ability to change the entity language from the edit form is enabled, aliases are lost when the language is modified.
Steps to reproduce
- Enable language module and activate 2 languages in a clean Drupal site, A&B
- Edit a content type and check the "Show language selector on create and edit pages" option
- Create a node of the content type above and fill the alias field
- Edit the node and change the language to B (You can modify the alias field or not)
- Save
Expected result
The alias is updated and available in language B
Actual result
The alias is lost and is necessary to edit again the node only to save the alias in language B
Proposed resolution
Remaining tasks
User interface changes
API changes
None
Data model changes
None
Release notes snippet
Issue fork drupal-3259403
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:
- 3259403-aliases-are-lost
changes, plain diff MR !1679
Comments
Comment #3
plopescUpdate status
Comment #4
cilefen commentedIs this related to, or the same as #2689459: If you don't want to translate your URL alias, the original URL alias won't work with your translations ?
Comment #5
plopescThank you for pointing out that issue. I was unable to find anything related before I created this one.
They could be related, but I think it's a different use case.
In the issue mentioned above, the editor wants to translate the node, but preserve the alias. However, in this issue, what we try is to modify the base language of the node, and modify the alias language accordingly during the process. It's not even necessary to enable content_translation module to reproduce it.
If the alias language is not updated, the alias is deleted by mistake in
PathFieldItemList::delete()method.Said this, it could be possible that this issue is a secondary effect of the mentioned issue.
Comment #8
smustgrave commentedThis issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.
Can confirm the issue following the steps in the IS.
The patch cleanly applies to 10.1 but the MR needs to be updated please
Comment #10
yash.rode commentedThis issue appears to be a duplicate of #1125428: Language-specific aliases only work with url-based language negotiation, could we close this one? I have already added this fix to that issue.
Comment #11
yash.rode commentedComment #12
smustgrave commentedWill move over credit.