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.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | workbench-moderation-preview-2741965-5.patch | 1.17 KB | brenk28 |
| #4 | workbench-moderation-preview-fix-2741965-4.patch | 1.25 KB | brenk28 |
| #3 | workbench-moderation-preview-2741965-3.patch | 1.01 KB | brenk28 |
| #2 | workbench-moderation-preview-2741965-2.patch | 1.01 KB | brenk28 |
Comments
Comment #2
brenk28 commentedThe attached patch saves the moderation state and uses if the has_been_previewed property of form_state has been set.
Comment #3
brenk28 commentedUploaded the wrong patch, the patch in #2 is not using the set method properly.
Comment #4
brenk28 commentedAnd after further testing, that patch in #3 doesn't actually work. Here is another using a method but same concept.
Comment #5
brenk28 commentedPosted the previous patch without doing a little cleanup first. Sorry about that. Here is yet another.
Comment #6
gclicon commentedSetting this to needs review so that hopefully the automated testing fires. I tested this myself and looks to work perfectly.