In sf_user and sf_node, calls are made to salesforce_api_retrieve. However both sf_user and sf_node assume that the result will be a single object, when salesforce_api_retrieve can return an array of objects (even if it is an array of one object...). Patch coming.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 1147420-multiple-objects-4.patch | 3.37 KB | kostajh |
| #3 | 1147420-multiple-objects.patch | 2.88 KB | kostajh |
Comments
Comment #1
kostajh commentedHere's a patch for sf_node and sf_user. I'm sure this needs to be fixed elsewhere, as it's not just salesforce_api_retrieve, but upsert that is also returning arrays of single objects. I've only just encountered this in switching to a new "full" sandbox (I was using a configuration only sandbox before). Has anyone else run into this problem?
Comment #2
dpearcefl commentedUmm, what patch? ;-)
Comment #3
kostajh commentedOops! long day.
Comment #4
kostajh commentedUpdated patch checks to see if the array has at least 1 element.
As an alternative, we could re-write function salesforce_api_retrieve($ids, $name) to have a third argument, $multiple = TRUE, and return an array of objects depending on whether that argument is set. We could do the same with upsert and and other salesforce_api functions.
Comment #5
kostajh commentedCommitted to 6.x-2.x-dev: http://drupalcode.org/project/salesforce.git/commit/149d7a5