I'm running into a weird issue. When I try to use the Workflow state change form block and I add a comment to the workflow log, it overwrites the data in $node->content['body']['#value'] with the node's cck field data. That's right, it replaces the data in the node's Body field with the labels and values of every CCK field from that node.

Each time I change the state and add a comment log, it adds that same data again. So if I change the state 3 times and add 3 comments, the cck data will show up 3 times in $node->content['body']['#value'].

This also happens when calling the form directly from the node template using "print workflow_extensions_change_state_form($node);").

However, it works normally if I visit the /node/nid/workflow tab and change the state / add a comment there.

Comments

rdeboer’s picture

Hi clockwood,
Thanks for your report.
I'm really sorry, but I'm very busy at the moment.
Maybe the community can chip in here?
Rik

rdeboer’s picture

@clockwood
Hi, I've just spent some time trying to reproduce your issue. Created a CCK text field on the Story type.
Created a piece of Story content with a body and a value in the CCK text field.
Put the "Workflow state change form" block in the left side bar.
Changed state several times, with and without a workflow comment.
Tried it with the single-action buttons, as well as the radio buttons.
Used it with and without scheduled transition date.

All good: story body does not change. Can't reproduce....

Would you be able to give more detailed instructions on how to reproduce your problem?
Rik

rdeboer’s picture

Status: Active » Postponed (maintainer needs more info)

Thinking about the above a bit more...
Can you think of any modules on your system that may interfere?
Try disabling them one by one and see if that makes a difference.

clockwood’s picture

Let me do some more in-depth testing and see if I can track down what on my end might be causing it. I'll post back here hopefully in a day or two.

clockwood’s picture

After quite a bit more testing and disabling all non-core modules, I've come to the conclusion that it's a likely an issue with the workflow module itself. Seems like the problem is actually only happening when the state change form is printed in the template. If I remove the form from the template, the block seems to work properly.

I also tried some code found in the Workflow issue queue to print out the form:

module_load_include('inc', 'workflow', 'workflow.pages');
print workflow_tab_page($node);

But it also adds the CCK data to the body field like in my original post.

I found something of a workaround. I can call the workflow extensions block from the node template using module_invoke and it seems to be working.

rdeboer’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

Ok! Closing.