Index: node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node.module,v retrieving revision 1.404 diff -U3 -r1.404 node.module --- node.module 28 Sep 2004 19:13:03 -0000 1.404 +++ node.module 29 Sep 2004 15:47:11 -0000 @@ -1063,9 +1063,6 @@ $node->teaser = node_teaser($node->body); } - // Create a new revision when required. - $node = node_revision_create($node); - if (user_access('administer nodes')) { // Set up default values, if required. if (!$node->created) { @@ -1104,16 +1101,24 @@ } else { // Validate for normal users: - $node->uid = $user->uid ? $user->uid : 0; + $node->uid = ($node->uid >= 0) ? $node->uid : $user->uid; + + if (!$node->nid) { + // Preserve these settings for nodes that exist. + $node->status = variable_get("node_status_$node->type", 1); + $node->promote = variable_get("node_promote_$node->type", 1); + $node->sticky = variable_get("node_sticky_$node->type", 0); + } + // Force defaults in case people modify the form: - $node->status = variable_get("node_status_$node->type", 1); - $node->promote = variable_get("node_promote_$node->type", 1); $node->moderate = variable_get("node_moderate_$node->type", 0); - $node->sticky = variable_get("node_sticky_$node->type", 0); $node->revision = variable_get("node_revision_$node->type", 0); unset($node->created); } + // Create a new revision when required. + $node = node_revision_create($node); + // Do node-type-specific validation checks. node_invoke($node, 'validate'); node_invoke_nodeapi($node, 'validate');