Wrong initial state for new nodes
edde42 - April 12, 2009 - 00:34
| Project: | Workflow |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I have a workflow with three stages In Draft, In Review and Live. The author can only move it from draft to review and from live back to draft.
The bug is that when an author creates a new node both In Draft and Live are listed and Live is preselected. In the from/to section, in the workflow configuration, I have only ticked that author can move from creation to In Draft. Thus if they, which most of them most likely will, submit the node without changing this it will be saved with creation as stage and thus the workflow will not work at all for these nodes.

#1
I have managed to find a workaround for this by using and Action/Trigger that moves it to In Draft when a new node is created.
#2
OK, I backtrack on the above comment. That workaround didn't fix the problem, it just created another.
I am using the Workflow Fields module with workflow. I had a major problem that authors could not create their content profile. It works when Workflow Fields is disabled, but not when it is enabled. It all comes down to that Workflow for some reason think that new nodes are in the Live state, which is what Workflow Fields filters on. See #444112: User cant create their Content Profile for more info on what problems that created for me.
Like in #327144: workflow-state tokens are reversed the author can only move a new node into one state, In Draft, so I tried that patch but it didn't change anything.
I am also using Content Profile with this content type. The Content Admin has no problem going to the users page and create the node for them. When the CA saves it the Action/Trigger kicks in and makes sure it is In Draft. From there everything works as it should and the author (user) can edit their profile and move to In Review and from Live back to In Draft as the workflow stipulates.
I haven't found any settings that let me define what initial state a new node shall have before it is saved for the first time. I would really appreciate some help here to find out what it is that makes Workflow to set it to Live in Creation.
#3
OK, faffing around in the db tables seems to fix all my problems today.
In workflow_node I had a row with the following data:
nid=0, sid=4, uid=1, stamp=1239228241
I simply changed sid to 2 and eureka the author could all of a sudden create their nodes.
I have no idea how a row for node 0 ended up here, I certainly didn't add it. For some reason it makes the workflow think that new nodes shall be in stage 4...
Is it supposed to be there? I have deleted it and everything seems to work fine without it. If it is supposed to be there, please let me know and I will put it back...