--- /home/kafkala/temp/media_mover/media_mover_api.module	2009-08-19 05:19:05.000000000 -0500
+++ /home/kafkala/public_html/sites/all/modules/media_mover/media_mover_api.module	2009-08-19 05:49:58.000000000 -0500
@@ -1052,7 +1052,17 @@ function media_mover_api_get_node_from_f
       }
     }
   }
-  return node_load($nid);
+
+  /* Comment by Zaczek August 19th, 2009: The node_load function only loads data from core tables. This was causing the Media_Mover module to update the record with NULL data. See issues: http://drupal.org/node/486206 and http://drupal.org/node/368956
+
+The solution is to use the function content_node_load written by alonpeer and described here: http://drupal.org/node/360541
+
+I have added this function to the API, as it might be useful in other situations.
+
+  */
+
+  return media_mover_content_node_load(array('nid' => $nid));
+
 }
 
 
@@ -3361,3 +3371,101 @@ function theme_media_mover_api_configura
   );
   return $form;
 }
+
+/**
+* Based on the core node_load().
+* Load a node object from the database, using both core node fields and CCK fields.
+* See http://drupal.org/node/360541
+*
+* @param $param
+*   An array of conditions for core node fields to match against in the database query.
+*   Since we also have the CCK conditions, this parameter can also be NULL.
+* @param $cck_param
+*   An array of conditions for CCK fields to match against in the database query
+* @param $revision
+*   Which numbered revision to load. Defaults to the current version.
+*
+* @return
+*   A fully-populated node object.
+*/
+function media_mover_content_node_load($param = NULL, $cck_param = array(), $revision = NULL) {
+  $arguments = array();
+  if (is_array($param)) {
+    // Turn the conditions into a query.
+    foreach ($param as $key => $value) {
+      $cond[] = 'n.'. db_escape_table($key) ." = '%s'";
+      $arguments[] = $value;
+    }
+    $cond = implode(' AND ', $cond);
+  }
+
+  // Process CCK parameters.
+  $cck_tables = array();
+  if (count($cck_param)) {
+    // Turn the conditions into a query.
+    $i = 1;
+    foreach ($cck_param as $key => $value) {
+      $db_info = content_database_info(content_fields('field_'. $key));
+      // If the field is from another table, increment sequence
+      if(!isset($cck_tables[$db_info['table']])){
+        $cck_tables[$db_info['table']] = 'cck'. $i;
+      }     
+      $i++;
+      if($db_info['columns']['nid']){
+        // For nodereference fields
+        $cck_cond[] = $cck_tables[$db_info['table']] .'.'. db_escape_table($db_info['columns']['nid']['column']) ." = '%s'";
+      } else {
+        $cck_cond[] = $cck_tables[$db_info['table']] .'.'. db_escape_table($db_info['columns']['value']['column']) ." = '%s'";
+      }
+      $arguments[] = $value;
+    }
+    if (is_array($cck_cond)) {
+      $cond .= (isset($cond) ? ' AND ' : ''). implode(' AND ', $cck_cond);
+      foreach ($cck_tables as $table => $nick) {
+        $cck_join .= ' INNER JOIN {'. $table .'} '. $nick .' ON '. $nick .'.nid = n.nid';
+      }
+    }
+  }
+
+  // Retrieve a field list based on the site's schema.
+  $fields = drupal_schema_fields_sql('node', 'n');
+  $fields = array_merge($fields, drupal_schema_fields_sql('node_revisions', 'r'));
+  $fields = array_merge($fields, array('u.name', 'u.picture', 'u.data'));
+  // Remove fields not needed in the query: n.vid and r.nid are redundant,
+  // n.title is unnecessary because the node title comes from the
+  // node_revisions table.  We'll keep r.vid, r.title, and n.nid.
+  $fields = array_diff($fields, array('n.vid', 'n.title', 'r.nid'));
+  $fields = implode(', ', $fields);
+  // Rename timestamp field for clarity.
+  $fields = str_replace('r.timestamp', 'r.timestamp AS revision_timestamp', $fields);
+  // Change name of revision uid so it doesn't conflict with n.uid.
+  $fields = str_replace('r.uid', 'r.uid AS revision_uid', $fields);
+
+  // Retrieve the node.
+  // No db_rewrite_sql is applied so as to get complete indexing for search.
+  if ($revision) {
+    array_unshift($arguments, $revision);
+    $node = db_fetch_object(db_query('SELECT '. $fields .' FROM {node} n INNER JOIN {users} u ON u.uid = n.uid INNER JOIN {node_revisions} r ON r.nid = n.nid'. $cck_join .' AND r.vid = %d WHERE '. $cond, $arguments));
+  }
+  else {
+    $node = db_fetch_object(db_query('SELECT '. $fields .' FROM {node} n INNER JOIN {users} u ON u.uid = n.uid INNER JOIN {node_revisions} r ON r.vid = n.vid'. $cck_join .' WHERE '. $cond, $arguments));
+  }
+
+  if ($node && $node->nid) {
+    // Call the node specific callback (if any) and piggy-back the
+    // results to the node or overwrite some values.
+    if ($extra = node_invoke($node, 'load')) {
+      foreach ($extra as $key => $value) {
+        $node->$key = $value;
+      }
+    }
+
+    if ($extra = node_invoke_nodeapi($node, 'load')) {
+      foreach ($extra as $key => $value) {
+        $node->$key = $value;
+      }
+    }
+  }
+
+  return $node;
+}
