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.

CommentFileSizeAuthor
salesforce-0.patch823 bytesentendu

Comments

kostajh’s picture

Status: Active » Needs review
aaronbauman’s picture

Status: Needs review » Fixed

committed 794ab4bb

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.