Problem/Motivation

I have a pull mapping that maps LastModifiedDate to a node's last updated property. This results in the following error:
duplicate field selected: LastModifiedDate in Salesforce->apiCall() (line 104 of .../salesforce/includes/salesforce.inc).
Tracing this issue back, it appears that while Id is prevented from being duplicated in the SalesforceSelectQuery fields of salesforce_pull_get_updated_records(), LastModifiedDate is not. Futhermore, it's not necessary to use a foreach on $mapped_fields. A simple array_merge() will suffice.

Proposed resolution

Replace the mapping field's foreach in salesforce_pull_get_updated_records() with a simple array_merge(). This ensures Id and LastModifiedDate are part of the query, but doesn't double up any query selections.

Remaining tasks

Review the attached patch.

User interface changes

None

API changes

None

Data model changes

None

CommentFileSizeAuthor
#3 2553413-3.patch906 bytespianomansam
#2 2553413-1.patch888 bytespianomansam

Comments

pianomansam created an issue. See original summary.

pianomansam’s picture

Status: Active » Needs review
StatusFileSize
new888 bytes
pianomansam’s picture

StatusFileSize
new906 bytes

Forgot a drupal_map_assoc(). Patched updated.

  • aaronbauman committed cb199d2 on 7.x-3.x
    Issue #2553413 by pianomansam: Mappings with LastModifiedDate field fail...
aaronbauman’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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