how to post text into a node (using #process)

hobo - November 19, 2008 - 22:00

I'm working on updating cck_time from drupal 5 to drupal 6. I have been following this tutorial (http://drupal.org/node/191796#191796-widgets)

I don't know how to post text into the node. I can show the new cck type. I can validate it. But i don't know how to use #process to attach text to the new node.

Are there any examples or tutorials that may apply here?

==========================More details===================

I have successfully added the widget to an image. I made a function cck_time_widget which displays the form inputs.

My problem is that i can't figure out how to get new information posted into the image node.

This is what the tutorial says:
The widget could still build out a complete form element in this stage, but the core elements now only create a placeholder at this point, and are built out more completely using #process and are validated using #element_validate. They also use hook_elements() to make themselves available as FAPI element types.

I can validate:
$my_form[$field['field_name']]['#element_validate'] = array('cck_time_validate');
this calls my function:
function cck_time_validate($element, &$form_state)

BUT when i try to register a #process funtion:
$my_form[$field['field_name']]['#process'] = array('cck_time_process' => array());
It does not call this function:
function cck_time_process(){
print 'hello from cck_time_process()';
exit;
}

Really I don't know how to post the values from my widget into the image node.

this is from the Drupal 5 module- cck_time_widget function (that i'm trying to do in drupal6):
case 'process form values':
$node_field[0]['value'] = $node_field['hour'] .':'. $node_field['minute'];

 
 

Drupal is a registered trademark of Dries Buytaert.