Closed (fixed)
Project:
Workflow
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Dec 2009 at 06:33 UTC
Updated:
16 Mar 2010 at 22:30 UTC
I noticed that when commenting on node posts, workflow can be changed but not scheduled to be changed. Looking into the code, this was obvious because the values from the comment form submission were not being passed onto the workflow function that executes state changes.
workflow_comment() needs to be changed like this:
/**
* Implementation of hook_comment().
*/
function workflow_comment($a1, $op) {
if (($op == 'insert' || $op == 'update') && isset($a1['workflow'])) {
$node = node_load($a1['nid']);
$sid = $a1['workflow'];
$node->workflow_comment = $a1['workflow_comment'];
if (isset($a1['workflow_scheduled'])) {
$node->workflow_scheduled = $a1['workflow_scheduled'];
$node->workflow_scheduled_date = $a1['workflow_scheduled_date'];
$node->workflow_scheduled_hour = $a1['workflow_scheduled_hour'];
}
workflow_transition($node, $sid);
}
}
Comments
Comment #1
jonathan_hunt commented+1 for this. This change is working for me.
Comment #2
jvandyk commentedCommitted. Will appear in 6.x-1.4.