When the first state of a workflow is created, for example Draft, the transition 'creation ---> draft' is available. If later the draft state is deleted there is no way to recovery that 'creation' transition. The attached patch provides one possible solution. It allows the 'creation' transition to be applied or moved to any state. It does not automatically re-assign the creation state, I tried that and it didn't "feel" right.
I have tried to keep with the general user interface of Drupal. This is my first patch to Drupal and my first PHP coding experience. The SQL code written should be compatible with MySQL and PostgreSQL (speaking of which I miss PostgreSQL's full featured SQL every time I have to code a query for MySQL) but has only been tested on MySQL as I have problems with Drupal and PostgreSQL and lack the time to apply all the patches.
The patch also includes the workflow component in the patch submitted for http://drupal.org/node/24447. This added a new function used by that post's action extensions (and a handy one at that). The code is not bullet proof, see comments in the patch for possible race conditions and other limitations.
Finally, feel free to remove the 'CRG:' text from the comments if this is merged in with the code. I use these to quickly identify what I have changed when experimenting with a new system.
| Comment | File | Size | Author |
|---|---|---|---|
| workflow.module.crg.patch | 4.07 KB | robb |
Comments
Comment #1
mfredrickson commentedThis bug report is wicked old. I'm fairly certain this problem has been fixed in the last 1.5 years since this bug was filed.
Please reopen if the bug persists with a recent copy of workflow. Thanks.
Comment #2
moshe weitzman commented@mark - nice use of adjective wicked. you ever live near me in boston? thats how we talk.