If there is a state that has limited transitions, if that state is selected and a node is previewed, the limitations are applied after previewing. For example:

1. A state "Archived" has "Draft" and "Published" as it's defined transition to states.
2. A User selects "Archived" as the moderation state and clicks preview.
3. After previewing, when a user clicks "Back to content editing", the formElement method in ModerationStateWidget.php now on that updated value of Archived when fetching from getValidTransitions and now the user is limited to "Draft" and "Published". Their original selection of "Archived" is not actually available.

Comments

brenk28 created an issue. See original summary.

brenk28’s picture

The attached patch saves the moderation state and uses if the has_been_previewed property of form_state has been set.

brenk28’s picture

Uploaded the wrong patch, the patch in #2 is not using the set method properly.

brenk28’s picture

And after further testing, that patch in #3 doesn't actually work. Here is another using a method but same concept.

brenk28’s picture

Posted the previous patch without doing a little cleanup first. Sorry about that. Here is yet another.

gclicon’s picture

Status: Active » Needs review

Setting this to needs review so that hopefully the automated testing fires. I tested this myself and looks to work perfectly.