function workflownode_comment_update in Workflow 7.2
Implements hook_comment_update().
1 call to workflownode_comment_update()
- workflownode_comment_insert in workflow_node/
workflownode.module - Implements hook_comment_insert().
File
- workflow_node/
workflownode.module, line 220 - Hooks and functions for the 'conventional' (version D5/D6/D7.1) Workflow Node, remnants of nodeapi.
Code
function workflownode_comment_update($comment) {
// Retrieve the data from the form.
if (!isset($comment->workflow_field)) {
// For this type_map, user did not want a form here.
return;
}
$form = array();
// Retrieve the data from the form.
// Add form values (field, instance, entity_type, entity), then form input.
$form_state = array();
$form_state['values']['workflow_field'] = $comment->workflow_field;
$form_state['values']['workflow_instance'] = $comment->workflow_instance;
$form_state['values']['workflow_entity_type'] = $comment->workflow_entity_type;
$form_state['values']['workflow_entity'] = $comment->workflow_entity;
// For some reason, the Workflow Form does not return the form in a 'workflow' array.
// @todo: correct this, or filter on 'workflow' elements.
$form_state['input'] = (array) $comment;
workflow_transition_form_submit($form, $form_state);
}