wagtail icon indicating copy to clipboard operation
wagtail copied to clipboard

Saving a draft without making changes resets the workflow with `WAGTAIL_WORKFLOW_REQUIRE_REAPPROVAL_ON_EDIT = True`

Open zerolab opened this issue 2 months ago • 4 comments

Issue Summary

When WAGTAIL_WORKFLOW_REQUIRE_REAPPROVAL_ON_EDIT = True, if one saves a draft without making any changes, then approves, the workflow resets back to the first step

Steps to Reproduce

  1. Create a workflow with three steps (two is also fine), and assign to a relevant part of the tree.
  2. Create a page and submit for moderation.
  3. Approve to the last step, or at least one step.
  4. Click "Save draft" without making any changes.
  5. Click "Approve"
  6. The workflow goes to the first step. Expected: the page publishes, or moves to the next step.

The logic for WAGTAIL_WORKFLOW_REQUIRE_REAPPROVAL_ON_EDIT = True kicks in if there is a new revision saved. However, if you do not make any changes, we should not really have a new revision -- from a user perspective, nothing has changes, so the workflow should not reset.

Technical details

  • Wagtail version: latest main

Working on this

Anyone can contribute to this. View our contributing guidelines, add a comment to the issue once you’re ready to start.

zerolab avatar Nov 13 '25 09:11 zerolab

However, if you do not make any changes, we should not really have a new revision

That sounds more like a different thing that's not necessarily related to workflows, and would be a change in behaviour that could be unexpected. Does that have to be done in order to achieve the main goal, i.e. to not require reapproval when new drafts are saved without any changes?

laymonage avatar Nov 13 '25 13:11 laymonage

hey @zerolab can i work on this issue ?

Swyamk avatar Nov 14 '25 08:11 Swyamk

Thanks for your interest! We don't assign issues outside the core team. Please give our first contribution guide a read. The short version - always check the issue carefully, especially for any signs of an existing PR. If there's nothing, and no one else mentioned they are working on it, say you’re taking on the issue in a comment and go for it. In this case, first step is to reproduce the issue.

thibaudcolas avatar Nov 17 '25 10:11 thibaudcolas

@zerolab i like to work on this i think When WAGTAIL_WORKFLOW_REQUIRE_REAPPROVAL_ON_EDIT=True, only task states linked to the latest revision count as "successful". Since a new revision was created when clicking "Save draft", the previously approved task states are now linked to an old revision, so they no longer count as successful. The workflow thus resets to the first task.

amxnn05 avatar Nov 22 '25 05:11 amxnn05