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
- Create a workflow
- Add 20+ workflow states
- Observe that "Creation is no longer at the top of the list
- 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
Comment #2
ergonlogicHere's a simple patch that just sets the "Creation" state weight to -1000. This works nicely in my use-case.
Comment #4
johnvThanks. Committed.