Problem/Motivation

The "Creation" workflow state is forced to use a weight of -11. This is intended to ensure that it always comes first. However, is cases where we have lots of workflow states, this backfires and forces it to be after some other workflow states.

Steps to reproduce

  1. Create a workflow
  2. Add 20+ workflow states
  3. Observe that "Creation is no longer at the top of the list
  4. Furthermore, observe that you cannot fix this by dragging workflow states above "Creation" to below it, as it will reset the weight upon saving the form.

Proposed resolution

The simplest solution appears to be updating the code where it hard-codes "-11" to be an even lower weight. I'd suggest something like -1000, so that only the most extreme cases would see a conflict here.

A more comprehensive solution might be to find the lowest weight for any other workflow state, and set Creation's weight lower than that.

Remaining tasks

Roll a trivial patch to implement the simple solution noted above.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Comments

ergonlogic created an issue. See original summary.

ergonlogic’s picture

Version: 8.x-1.7 » 8.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new471 bytes

Here's a simple patch that just sets the "Creation" state weight to -1000. This works nicely in my use-case.

  • johnv committed a0376427 on 8.x-1.x authored by ergonlogic
    Issue #3421952 by ergonlogic: Workflows with many states do not enforce...
johnv’s picture

Version: 8.x-1.x-dev » 8.x-1.7
Status: Needs review » Fixed

Thanks. Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.