Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295845

Unable to save a translation if the path alias changes

$
0
0

Problem/Motivation

This is a bit of a complex bug I'm encountering. It involves 3 core modules and optionally 1 contrib (pathauto), but I think content moderation may be at the heart of it because I can't seem to reproduce it with non-moderated entities.

The problem is that a translation of an entity cannot be saved if the path alias differs from the published original language version.

To reproduce:

1) Create a node type.
2) Add a moderation workflow to it.
3) Add another language to your site.
4) Enable content translations on that node.
5) Add a pathauto pattern to the node that contains the title.
6) Create an English version of the node.
7) Publish the node through the workflow.
8) Add a translation of that node. Change the title.
9) Save the node (as a draft or other unpublished state - I'm not sure why you can save it once but not a second time).
10) Edit the node again and try to save again (as a draft or other unpublished state).

Form error: "You can only change the URL alias for the published version of this content."

My initial thought was that Pathauto was to blame but after looking in PathAliasConstraintValidator.php I feel like there needs to be some additional logic for translations, moderation, etc. I think (not know) that Pathauto is just exposing this issue because it's changing the alias.

Proposed resolution

TODO

Remaining tasks

Investigate further.


Viewing all articles
Browse latest Browse all 295845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>