Report based on #2930599: Unable to save a translation if the path alias changes (which is 'works as designed' imho).
Problem/Motivation
User can't add new draft for a content translation of a node if the path alias of the latest published entity (original language) is different from the path alias of the new translation draft's form.
Steps to reproduce
Setup
- (as an administrator user, suggested install profile:
standard
) - Enable
node
,content_moderation
,content_translation
andpath
modules. - Add an another language.
- Create a node type, add a workflow to it and make it translatable. Use the defaults settings of the content translation form.
- Create a node with in the default language with path alias. Publish it.
- Create a translation for the node with a translated path alias which is different from the one the default node has. Publish this translation as well.
Scenario 1
- Try to add a new draft for the translation while not changing the path alias.
- Expected: new draft is successfully saved while alias of the published translations remain the same.
- What happens:
PathAliasConstraintValidator
returns a validation error You can only change the URL alias for the published version of this content.
Scenario 2
- Now try to add a new draft for the translation while changing the path alias to the one what the original published entity revision has (original means the original language).
- Expected: Validation error.
- What happens: New translation draft successfully saved, and the alias of the published (default) translation revision changes to the one we just filled in.
Proposed resolution
Extend logic of PathAliasConstraintValidator
to check for the default revision of the current entity language, and not the original entity.
Remaining tasks
Copy my patch from #2930599: Unable to save a translation if the path alias changes here.Extend it with a test for Scenario 2
Get a review.
User interface changes
Nothing.
API changes
Nothing.
Data model changes
Nothing.