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?

Comments

maximago’s picture

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

JacobSingh’s picture

Category: support » feature

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

Ocyrhoé’s picture

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".

astra’s picture

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"?

Ocyrhoé’s picture

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...

dugawug’s picture

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.

robertDouglass’s picture

Title: How to update state on existing nodes after workflow install » Set workflow state on existing nodes to <created> when defining new workflow.

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.

jvandyk’s picture

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.

robertDouglass’s picture

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?

aac’s picture

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!!

Leeteq’s picture

Ref. this module (it refers to this issue):
http://drupal.org/project/workflow_post_install

robertDouglass’s picture

Wow. A whole other module to correct this problem. How sad.

samchok’s picture

Can you please show me an example of those operations? thank you.

dbassendine’s picture

Another aspect to this problem is that both the Views and Workflow Summary filters for "No state" rely on nodes having an entry in workflow_node with sid = 0. Of course, pre-existing content does not have entries in this table, even after the content type is added to workflow config. And there seems to be no way for any other node to be listed in the table and have an sid value of 0 - rendering the "No state" filters useless.

If the filters are going to be retained as they are, it would be useful to have a function that scans pre-existing content for content types that are added to workflow config, then gives them an entry in workflow_nodes. Alternatively we could add "No state" as an entry on the bullk update. Then, at least, all nodes would be recongnised by workflow filters whether they have a state or not.

Thanks, David.

Bastlynn’s picture

Status: Active » Closed (won't fix)

Hi,

With the release of Drupal 7, Drupal 5 is no longer receiving security updates, reviews, or development from many contributed modules. Since 5 is now considered a depreciated version, you really should seriously look into upgrading to Drupal 6 or 7. The newer versions of Drupal work better, have more support, and will be safer (literally! security patches!) for your website. We are currently working on a new release for Workflow to Drupal 7. In light of that, further support for Drupal 5 issues is infeasible at the moment. Please consider upgrading to Drupal 6 or 7 in the near future - you'll be glad you did.

- Bastlynn