Index: content_profile.migrate.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/migrate_extras/content_profile.migrate.inc,v
retrieving revision 1.1
diff -u -p -r1.1 content_profile.migrate.inc
--- content_profile.migrate.inc	13 Jan 2010 04:04:28 -0000	1.1
+++ content_profile.migrate.inc	14 Jan 2010 05:01:14 -0000
@@ -12,7 +12,14 @@
 function content_profile_migrate_fields_user($type) {
   // Get any CCK fields attached to content profiles
   $cp_types = content_profile_get_types();
-  $fields = array();
+  $fields = array(
+    'profile|status' => t('Profile Node: Published'),
+    'profile|promote' => t('Profile Node: Promoted to front page'),
+    'profile|sticky' => t('Profile Node: Sticky at top of lists'),
+    'profile|revision' => t('Profile Node: Create new revision'),
+    'profile|taxonomy' => t('Profile Node: Taxonomy'),
+  );
+
   foreach ($cp_types as $type => $info) {
     $profile_fields = migrate_invoke_all('fields_node', $type);
     foreach ($profile_fields as $key => $value) {
@@ -57,6 +64,28 @@ function content_profile_migrate_complet
       $node[$type]->$destfield = $newvalue;
     }
   }
+  
+  // Iterate through every attribute of the user object that has a '|'
+  // character in its key, and add that attribute to the node object.
+  // This allows data such as CCK fields to be added in
+  // hook_migrate_prepare_user(), in the form:
+  //   $key = 'profile|field_cck_foo';
+  //   $user->$foo = $cck_data;
+  // And to then propagate through to the node object as:
+  //   $node->field_cck_foo;
+  foreach (array_keys((array) $account) as $acct_key) {
+    unset($type);
+
+    if (strpos($acct_key, '|') !== FALSE) {
+      $pieces = explode('|', $acct_key);
+      $type = $pieces[0];
+      $destfield = $pieces[1];
+
+      if (isset($type) && !isset($tblinfo->fields[$acct_key])) {
+        $node[$type]->$destfield = $account->$acct_key;
+      }
+    }
+  }
 
   // For each profile type, create the node attached to this user
   foreach ($cp_types as $type => $name) {
@@ -81,3 +110,15 @@ function content_profile_migrate_complet
 
   return $errors;
 }
+
+/**
+ * Implementation of hook_migrate_delete_node().
+ */
+function content_profile_migrate_delete_node($nid) {
+  // Delete the user object of the author of this node, if this node is of a
+  // content_profile node type.
+  $cp_types = content_profile_get_types();
+  if (($node = node_load($nid)) && isset($cp_types[$node->type])) {
+    user_delete($node->uid);
+  }
+}
