Problem/Motivation
When changing the language an existing path alias inside of a workspace, the path alias stops working.
Steps to reproduce
1. drush si
2. drush en -y workspaces content_translation
3. drush uli
4. Go to /admin/config/regional/language and add the Spanish language
5. Go to /admin/config/regional/content-language and enable translation for "Content", ensure to check "Article" under the "Content" fieldset
6. Add a new article node, and set the path alias to /test before saving it
7. Save the node
8. Switch to the staging workspace
9. Go to /admin/config/search/path/edit/1 and update the path alias to use "Not specified" language, save it.
10. Go to /test
See a 404 page.
Proposed resolution
The second proposed solution here should be reverted. That additional language condition causes the repository to not find a matching path alias if the langcode in the base & revision tables is different. This essentially means that changing the language of a path alias in a workspace does not work.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3486797
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:
- 3486797-updating-path-alias
changes, plain diff MR !10141
Comments
Comment #2
alecsmrekar commentedComment #3
alecsmrekar commentedComment #5
alecsmrekar commentedTest failure does not seem related:
Drupal\Tests\comment\Functional\CommentPreviewTest 0 passes 94s 1 failsComment #6
alecsmrekar commentedComment #7
smustgrave commentedThanks for reporting
Think next step will be to add test coverage showing the problem and that the change fixes it.
Comment #8
shalini_jha commentedI have replicated this issue, and the merge request fixes it. I will work for the test coverage.
Comment #9
shalini_jha commentedI have added test coverage for showing this issue, pipeline is green so moving this NR.
Kindly review.
Failing test :
Comment #10
smustgrave commentedTest coverage appears to be there so removing that tag.
Reviewing code and nothing stands out.
Comment #12
amateescu commented+1 for the RTBC. I added this in #3478240: Improve performance for path_alias queries in a workspace thinking that path aliases are translatable, but they're not :)
Comment #15
catchCommitted/pushed to 11.x, and cherry-picked to 11.1.x, thanks!
This doesn't cherry-pick to 10.5 cleanly so leaving fixed against 11.1.x for now. If you strongly feel it needs a 10.5 backport, please re-open with a backport MR.