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

  1. Enable language module and activate 2 languages in a clean Drupal site, A&B
  2. Edit a content type and check the "Show language selector on create and edit pages" option
  3. Create a node of the content type above and fill the alias field
  4. Edit the node and change the language to B (You can modify the alias field or not)
  5. 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

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

plopesc created an issue. See original summary.

plopesc’s picture

Status: Active » Needs review

Update status

cilefen’s picture

plopesc’s picture

Issue summary: View changes

Thank 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.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative

This 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

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

yash.rode’s picture

This 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.

yash.rode’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Closed (duplicate)

Will move over credit.