Content Moderation and Gatsby Preview interactions

Created on 14 February 2023, almost 2 years ago
Updated 31 August 2023, over 1 year ago

The current iteration of the 2.x module now requires Drupal Content Moderation and has a feature which will force a node state change to Draft when the "Open Gatsby Preview" button is selected. The ideas behind this makes sense for a couple of reasons:

  1. Drupal nodes have to be saved before a revision can be previewed by Gatsby
  2. If the current node is already published and being edited, you want to save it is a draft revision and preview that, without publishing the draft change

One issue I ran into with the above assumption is what happens when you have these three Content Moderation States:

  • Draft
  • Needs Review
  • Published

Let's say a new node is drafted and then sent to "Needs Review". The Reviewer should be able to open the node in a way to generate a preview of that revision in Needs Review. The problem is if the reviewer edits the node and clicks "Open Gatsby Preview", the node is moved to "Draft" and a new revision is generated when the node is saved, as expected.

I think we are on the right track to require Content Moderation and help Gatsby Previws actually preview unpublished revisions, but we need to think through ways to make it work smoother for at least standard moderation state setups.

I would like for hti sissue to allow the community talk through possible solutions. Please discuss.

One example solution I can think of would be to provide links to Open Gatsby Preview without editing a node or even saving it. Maybe we can even pull the correct revision to fire off a preview for the desired workflow state.

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States shrop

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @shrop
  • πŸ‡ΊπŸ‡ΈUnited States wweibel

    I agree that there needs to be a way to preview content (easily) without requiring a save. Not performing a save (and moderation state change) would alleviate the following ...

    There is an issue with the approach of saving and setting moderation state - hard setting to 'draft'. It may not obey the set workflow for the content or be what is desired even in a basic setup. The assumption that a moderation state change is required is incorrect. A user (and a workflow) could easily become confused when content is 'unpublished' as an unexpected consequence of attempting to preview the content. The applied workflow would (should) already be enforcing any necessary state change and it does not necessarily mean a return to the draft state.

Production build 0.71.5 2024