Typo in variable name fixed, and when an property exists on the object, but the id isn't actually populated for whatever reason (different issue), an upsert should still happen rather than an update.

Minor fixes attached.

CommentFileSizeAuthor
#4 push-fixes-2.patch8.1 KBrickyoh
soap-upsert-fixes.patch923 bytesrickyoh

Comments

kostajh’s picture

Status: Active » Needs review
levelos’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

kostajh’s picture

Status: Reviewed & tested by the community » Fixed

Committed in 02781ad. thanks @rickyoh!

rickyoh’s picture

StatusFileSize
new8.1 KB

Some other soap issues are as follows and semi-addressed in the following patch. This patch would only apply if the addition of the bundle property is added in here: http://drupal.org/node/1882342

  1. Pushing a single object returns a single object- not an array. salesforce_push_process_soap_results() expects an array so a single result must be made iterable so it can run through the routine of creating a salesforce_mapping_object or reporting errors.
  2. If pushing different kinds of sObjects in your payload, you must do so in separate upserts. The synced entities array that is passed to salesforce_push_process_soap_results() also needs to keep the same index.
  3. We need to check if the salesforce_mapping_object exists in salesforce_push_process_soap_results() before creating it (this errors and terminates on processing an update)
  4. If the bundle is added onto the salesforce_mapping_object table, we have to make sure that multiple entities using the same key (ie: a user entity and it's cooresponding profile2 entity) aren't in the same payload. In the case of users and profile 2 entities, the user would sync on the first cron run and the profile2 entity would sync on the subsequent cron run.

Status: Fixed » Closed (fixed)

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

  • Commit 02781ad on 7.x-3.x, 8.x-3.x, process-deleted-refactor authored by rickyoh, committed by kostajh:
    Issue #1985840 by rickyoh: Soap upsert/update fails
    

  • Commit 02781ad on 7.x-3.x, 8.x-3.x, mapped-object-ui authored by rickyoh, committed by kostajh:
    Issue #1985840 by rickyoh: Soap upsert/update fails