function _workflow_rules_node_set_state in Workflow 7
Action implementation: set current state, ignoring current user permission.
1 string reference to '_workflow_rules_node_set_state'
- _workflow_rules_rules_node_action_info in workflow_rules/
workflow_rules.node.inc - Implements subfunction of hook_rules_action_info().
File
- workflow_rules/
workflow_rules.rules.inc, line 141 - Rules integration for the Workflow module
Code
function _workflow_rules_node_set_state($node, $sids, $comment = NULL) {
// Select the last state on the list.
$sid = array_pop($sids);
if (!empty($comment)) {
$node->workflow_comment = $comment;
}
workflow_transition($node, $sid, TRUE);
unset($node->workflow_comment);
}