I have mapped the Salesforce field 'Id' into my Drupal node because I use it for various things. However, sf_import.drush.inc about line 236 hardcodes the file 'Id' into an SOQL select query.

Here is what I am running and what I get.

drush sf-import 3124860e3cb9faa393e014471460eced --count 1
drush: Error while querying Salesforce : INVALID_FIELD:
Description, Donation_Record_ID__c, Id, OwnerId, Response_Code__c, Type
                                    ^
ERROR at Row:2:Column:128
duplicate field selected: Id
Drush command terminated abnormally due to an unrecoverable error.                                                                                                                  [error]

Comments

dpearcefl’s picture

Status: Active » Needs review
StatusFileSize
new869 bytes

Also found another curious bug for nodes.

Patch attached.

EvanDonovan’s picture

Issue tags: +7.x-2.x

Tracking for 7.x-2.x.

Alice Heaton’s picture

Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new746 bytes

Hi,

The patch given by @dpearceMN fixes two issues :

  1. drush sf-import does not work if Id field is included in query ;
  2. drush sf-import does not work for nodes.

I have made the following modifications to the original patch :

  • cosmetic change ; use in_array rather than array_search
    to be consistent with the rest of the code in the file ;
  • Use '===' operator when checking for return value
    of strpos, as this may return FALSE. (because of this, the original
    patch would not have worked for non-node types. It now
    covers both cases).

The patch works for me. I'm setting this to 'major', because the drush sf-import command
is not working at the moment for node types at all.

kostajh’s picture

Do you mind re-rolling the patch using git diff? I couldn't get this to apply to 6.x-2.x.

Alice Heaton’s picture

StatusFileSize
new832 bytes

Here it is :)

kostajh’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Thanks Anselm! Committed to 6.x-2.x-dev: http://drupalcode.org/project/salesforce.git/commit/8602586

kostajh’s picture

Status: Patch (to be ported) » Fixed

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