Set workflow state on existing nodes to <created> when defining new workflow.
thededalus - October 13, 2007 - 03:02
| Project: | Workflow |
| Version: | 5.x-1.1 |
| Component: | Miscellaneous |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I have installed workflow & have successfully created a workflow such that when I create new content, it, well, flows through the intended path, the right roles have access to them.
However, what can I set my existing content to the final state or give them a psuedo history of having passed through each state?

#1
We did it on the dirty way:
INSERT INTO service_workflow_node
(nid,sid,uid,stamp)
(SELECT nid,'33','1','1195736390' FROM service_content_type_projecttasks);
thats not a good way, but it fixed this issue...
Daniel Greitens
www.maximago.de
#2
I think this is a new feature request, not an existing. I'd say the best way to implement this is a badly needed batch workflow changing.
Perhaps this is interesting:
http://drupal.org/project/views_bulk_operations
#3
You are rigth, I did it on 300 nodes with views_bulk_operations and the built'in workflow action "Change workflow state of a node to next state".
#4
That's nice feature to update state with views_bulk_operations. But the built in workflow action only allow update to next state.
Would it be possible to update to any state of workflow with an operation, such as "Change workflow state"?
#5
You have to code your own operations to update to a state
I've written some operations, one for each state I use. I don't know if it's the best way but I can post it...
#6
i'm having this same problem. i installed the workflow and actions modules after about 30+ pages are already produced, and now i can't seem to get this existing content to pass through a workflow. can someone tell me very plainly what i can do so in future this content can go through a workflow? i'm very surprised that it seems only new content is set up correctly for workflows.
#7
This is an important feature request. I'm updating the title a bit. I imported 4 million nodes and then defined my workflow. None of them are in the created state, whereas I'd expect all of them to be.
#8
You are confused.
There is no "created" state. Workflow defines the "creation" state.
That is the ethereal state that a node is in before it is created.
The correct state for these nodes is "No state" or "Undefined".
I agree that workflow should have a utility that allows mass assignment of states. I'm not sure if you can do it now with views, selecting the set of nodes that are in "No state", and using Views Bulk Operations to run the action "Change workflow state of post to new state" to assign them a state.
#9
So maybe there is another bug that has nothing to do with this. Here's what I did, and what happened.
1. Imported lots of nodes of content type listing.
2. Installed and set up a workflow for the content type listing.
3. Went to those node/x/workflow pages. All pages were blank. There was a workflow log table (just the headers) and a submit button, but no state transitions were possible. The states I had defined weren't even listed.
4. I created new listing nodes. Their node/x/workflow tabs worked as expected.
5. I looked in {workflow_node} There were entries for the new nodes but not for the old nodes.
6. I used a SQL query to add rows to {workflow_node}, which now looks like the following. Note the two listing nodes that I created manually at the top of the list:
mysql> select * from workflow_node limit 10;+---------+-----+-----+------------+
| nid | sid | uid | stamp |
+---------+-----+-----+------------+
| 3901952 | 2 | 1 | 1234556620 |
| 3901953 | 2 | 1 | 1234561228 |
| 4 | 2 | 1 | 1234567890 |
| 5 | 2 | 1 | 1234567890 |
| 6 | 2 | 1 | 1234567890 |
| 7 | 2 | 1 | 1234567890 |
| 8 | 2 | 1 | 1234567890 |
| 9 | 2 | 1 | 1234567890 |
| 10 | 2 | 1 | 1234567890 |
| 11 | 2 | 1 | 1234567890 |
+---------+-----+-----+------------+
7. All my nodes now can undergo workflow state changes.
So, now that we're both certain I'm confused, what is it that I'm confused about, and what's the fix for it?
#10
I have just started to use workflow 6.x-1.1. I found this post while surfing to find some solution to my problem http://drupal.org/node/416580.
I would suggest workflow developer that there should be an option (select box with single select) added while creating a workflow for a particular content type that "what state you want to assign for contents of that particular type which are already available?"
Thanks!!
#11
Ref. this module (it refers to this issue):
http://drupal.org/project/workflow_post_install
#12
Wow. A whole other module to correct this problem. How sad.
#13
Can you please show me an example of those operations? thank you.