Problem/Motivation
When reverting to a previous revision of an item of content, the new revision created matches the moderation state of the revision being reverted.
While this keeps the integrity of the workflow intact, since content can only be recreated in a state that was valid at some previous point in time, it may not always be what users expect and it limits the utility of reverting in general, since certain revisions can only be recreated and immediately published or can only be recreated and reverted back to a draft.
Steps to reproduce
- Create a draft Node e.g. titled Test v1
- Create a new draft e.g. titled Test v2
- Publish Test v2
- Decide you prefer Test v1 but want to tweak it first before republishing
- Click revert: Test v1 is immediately published and tweaking it first is not possible
Proposed resolution
The proposed resolution is to modify the revision revert confirmation form to include a moderation state select list. This will allow the user to select the desired moderation state for the new revision being created. The list of available moderation states will be filtered to only include those that the user has the permission to transition to.
Remaining tasks
- ☑ Update the revision revert form to include the moderation state select list.
- ☑ Add logic to filter the list of available moderation states based on user permissions.
- ☑ Update the form submission logic to save the selected moderation state to the new revision.
- ☑ Ensure the available workflow transitions and permissions are taken into account per #74.
- ☑ Add and update tests to ensure the new functionality is working as expected.
But there is one outstanding comment whether this should be set up to more broadly cover moderated content beyond Nodes.
User interface changes
A new "Moderation state" select list will be added to the revision revert confirmation form.
Introduced terminology
None
API changes
None
Data model changes
None
Release notes snippet
The confirmation screen for reverting Nodes when Content Moderation is enabled now let's the editor decide whether to revert to a particular moderation state. Previously reverting would always publish the older revision.