? 1011828.patch
? node-values.diff
? node_prepare.diff
? includes/modules/1006956.patch
Index: includes/uuid_node.features.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uuid_features/includes/uuid_node.features.inc,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 uuid_node.features.inc
--- includes/uuid_node.features.inc	7 Jan 2011 20:31:53 -0000	1.1.2.3
+++ includes/uuid_node.features.inc	24 Jan 2011 21:10:16 -0000
@@ -108,13 +108,32 @@ function uuid_node_features_revert($modu
  */
 function uuid_node_features_rebuild($module) {
   $nodes = module_invoke($module, 'uuid_features_default_content');
+  $manually_set = array(
+    'created' => array('table' => 'node', 'column' => 'created'),
+    'changed' => array('table' => 'node', 'column' => 'changed'),
+    'revision_timestamp' => array('table' => 'node_revisions', 'column' => 'timestamp'),
+    'last_comment_timestamp' => array('table' => 'node_comment_statistics', 'column' => 'last_comment_timestamp'),
+  );
   if (!empty($nodes)) {
     module_load_include('inc', 'node', 'node.pages');
-
     foreach ($nodes as $data) {
       $node = (object)$data;
-      node_object_prepare($node);
-
+      // Note which of these values have been set in the export 
+      foreach ($manually_set as $key => $values) {
+        if (isset($node->$key)) {
+          $manually_set[$key]['value'] = $node->$key;
+        }
+      }
+      // Perform tasks from node_object_prepare() without overwriting data
+      // in the exported node.
+      $node_options = variable_get('node_options_'. $node->type, array('status', 'promote'));
+      foreach (array('status', 'promote', 'sticky') as $key) {
+        if (!isset($node->$key)) {
+          $node->$key = in_array($key, $node_options);  
+        } 
+      }
+      node_invoke($node, 'prepare');
+      node_invoke_nodeapi($node, 'prepare');
       $existing = node_get_by_uuid($node->uuid);
 
       if (!empty($existing)) {
@@ -125,9 +144,26 @@ function uuid_node_features_rebuild($mod
       // The hook_alter signature is:
       // hook_uuid_node_features_rebuild_alter(&node, $module);
       drupal_alter('uuid_node_features_rebuild', $node, $module);
-
       $node = node_submit($node);
       node_save($node);
+      // The Node API is hard-coded to override certain values set in the node.
+      // Set them here. 
+      foreach ($manually_set as $key => $values) {
+        if (isset($values['value'])) {
+          $table = $values['table'];
+          $column = $values['column'];
+          $value = $values['value'];
+          if ($table == 'node_comment_statistics') {
+            $where = 'nid = %d';
+            $args = array($value, $node->nid);
+          }
+          else {
+            $where = 'nid = %d AND vid = %d';
+            $args = array($value, $node->nid, $node->vid); 
+          }
+          db_query("UPDATE {$table} SET $column = %d WHERE $where", $args);
+        }
+      }
     }
   }
 }
