diff --git a/sf_import/sf_import.module b/sf_import/sf_import.module index bb5116f..45bf4c4 100644 --- a/sf_import/sf_import.module +++ b/sf_import/sf_import.module @@ -204,7 +204,7 @@ function sf_import_batchjob($fieldmap_key, $extra, &$context) { $function = 'sf_' . $type . '_import'; if (function_exists($function)) { - $oid = $function($record, $map->name, $existing[$record['Id']]); + $oid = $function($record, $map->name, $existing[$record['Id']], $extra); } else { $context['finished'] = TRUE; diff --git a/sf_node/sf_node.module b/sf_node/sf_node.module index 5a0dcd3..7231cac 100644 --- a/sf_node/sf_node.module +++ b/sf_node/sf_node.module @@ -762,7 +762,7 @@ function sf_node_export($node, $name, $sfid = NULL) { * @return * The nid of the imported node or FALSE on failure. */ -function sf_node_import($sf_data, $name, $nid = NULL) { +function sf_node_import($sf_data, $name, $nid = NULL, $options = array()) { // Retrieve the object from Salesforce. $sf = salesforce_api_connect(); if (!$sf) { @@ -874,7 +874,8 @@ function sf_node_import($sf_data, $name, $nid = NULL) { $sfid = $sf_data->Id; if ((($map->automatic & SALESFORCE_AUTO_SYNC_CREATE) && $create) - || (($map->automatic & SALESFORCE_AUTO_SYNC_UPDATE) && !$create)) { + || (($map->automatic & SALESFORCE_AUTO_SYNC_UPDATE) && !$create) + || (!empty($options['extra-linked']) && $options['extra-linked'] == TRUE)) { // Store the Salesforce ID for the node and return TRUE. salesforce_api_id_save('node', $node->nid, $sfid, $name); } diff --git a/sf_user/sf_user.module b/sf_user/sf_user.module index 2a616f5..eafd7a0 100644 --- a/sf_user/sf_user.module +++ b/sf_user/sf_user.module @@ -571,7 +571,7 @@ function sf_user_export($uid, $name, $sfid = NULL) { * @return * The uid of the imported user or FALSE on failure. */ -function sf_user_import($sf_data, $name, $uid = NULL) { +function sf_user_import($sf_data, $name, $uid = NULL, $options = array()) { // Retrieve the object from Salesforce. $sf = salesforce_api_connect(); if (!$sf) { @@ -700,7 +700,8 @@ function sf_user_import($sf_data, $name, $uid = NULL) { $sfid = $sf_data->Id; if ((($map->automatic & SALESFORCE_AUTO_SYNC_CREATE) && $create) - || (($map->automatic & SALESFORCE_AUTO_SYNC_UPDATE) && !$create)) { + || (($map->automatic & SALESFORCE_AUTO_SYNC_UPDATE) && !$create) + || (!empty($options['extra-linked']) && $options['extra-linked'] == TRUE)) { // Store the Salesforce ID for the node and return TRUE. salesforce_api_id_save('user', $account->uid, $sfid, $name); }