--- content_taxonomy.module	2010-02-06 11:40:27.000000000 +0000
+++ content_taxonomy_new.module	2010-03-25 20:39:49.000000000 +0000
@@ -212,6 +212,23 @@ function content_taxonomy_field_formatte
   );
 }
 
+/**
+* Implementation of hook content_generate().
+* Returns an array for the node field which is then saved to the CCK tables
+* Also adds terms to the taxonomy property of node so that they are added
+* to the taxonomy tables
+*/
+function content_taxonomy_content_generate( &$node, $field ) {
+  $node_field = array();
+  $sql = "SELECT tid FROM {term_data} WHERE vid = %d ORDER BY RAND() LIMIT 1";
+  $term = db_fetch_object( db_query( $sql, $field[ 'vid' ] ) );
+  $node_field[] = array( 'value' => $term->tid );
+  if( $field['save_term_node'] ) {
+    $node->taxonomy[ $term->tid ] = $term->tid;
+  }
+  return $node_field;
+}
+
 
 /**
  * Theme function for 'default' text field formatter.
