By jonjon on
Hello,
I'm trying to update a specific node type's date when the user create / update it. The purpose of this modification is to set the node's date time to a specific CCK field. Here is my code:
function cleandate_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL){
if($node->type == 'image_of_the_day')
{
drupal_set_message('On Node ' . $op . ' - Date: ' . $node->date);
switch ($op) {
case 'validate':
$node->date = $node->field_publication_date[0]['value'];
drupal_set_message('After ' . $node->date);
break;
}
}
}
I do have the log messages but the problem is that the $node->date is never saved no mater what I try. Am I missing something ?
Thanks in advance.
Comments
Fixed, by reading this post:
Fixed, by reading this post: http://drupal.org/node/338626
I needed to make the modification in the "presave" state. That's all!