Line 769+
// Look for any matching records which we might want to update instead of creating duplicates.
if (empty($sfid)) {
$matches = salesforce_api_search_for_duplicates('export', $map->drupal_entity, $map->drupal_bundle, $entity, $name);
if (!empty($matches)) {
$sfid = reset($matches);
$entity->salesforce->sfid = $sfid;
salesforce_api_id_save($id, $sfid, $name, $map->drupal_entity, $map->drupal_bundle, 'export');
$entity = entity_load($map->drupal_entity, array($id), array(), TRUE);
}
}
This is the prematching code in sf_entity_export(). $entity is assumed in the rest of the module to be the entity itself; however, entity_load() returns an array indexed by ID.
Patch attached.
Comments
Comment #1
kostajh commentedComment #2
aaronbaumancommitted 794ab4bb