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

jonathan_hunt’s picture

+1 for this. This change is working for me.

jvandyk’s picture

Status: Active » Fixed

Committed. Will appear in 6.x-1.4.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.