Index: usernode.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/usernode/usernode.module,v
retrieving revision 1.12.2.18
diff -u -p -r1.12.2.18 usernode.module
--- usernode.module	7 Jun 2007 17:53:14 -0000	1.12.2.18
+++ usernode.module	27 Aug 2007 23:10:08 -0000
@@ -224,7 +224,8 @@ function usernode_create_node($user) {
  * This allows modules like auto_nodetitle to work and makes sure all hooks are invoked properly
  */
 function usernode_save_node($node) {
-  $values = array();
+  // The usernode_auto_create value is set so that form_alter knows we are using drupal_execute, rather than an interactive form submit
+  $values = array('usernode_auto_create' => TRUE);
 
   // workaround to disable drupal message "Your usernode has been created"
   $messages = drupal_get_messages();
@@ -387,14 +388,28 @@ function usernode_check_all($limit = 100
 }
 
 /**
+ * Helper function for array_walk_recursive
+ * Unsets any required fields anywhere in the form
+ */
+function usernode_form_nonrequired(&$item, $key) {
+  if ($key == '#required' && $item === TRUE) {
+  	$item = FALSE;
+  }
+}
+
+/**
  * Implementation of hook_form_alter().
  */
 function usernode_form_alter($form_id, &$form) {
   if ($form_id == USERNODE_CONTENT_TYPE .'_node_form' && !$_POST) {
     unset($form['delete']);
   }
-  //If the nodefamily module is activated, make sure that it knows that usernodes are lonely nodes
+  else if ($form_id == USERNODE_CONTENT_TYPE .'_node_form' && $form['#post']['usernode_auto_create'] === TRUE) {
+    // We unset any required fields in the array, which could prevent the node from saving
+    array_walk_recursive($form, 'usernode_form_nonrequired');
+  }
   else if ($form_id == 'node_type_form' && module_exists('nodefamily') && $form['#node_type']->type == USERNODE_CONTENT_TYPE ) {
+    //If the nodefamily module is activated, make sure that it knows that usernodes are lonely nodes
     nodefamily_content_type_set_max(USERNODE_CONTENT_TYPE, 1);
   }
 }
