When trying to use $contact->upsert() in the latest dev branch it seemed to be having trouble getting an existing contact, and I traced the problem to this line of code:

$existing_contact = redhen_contact_load(key($result['redhen_contact'][0]));

I looks like there is an extra [0], when the key function is being used to get the first element of the $result['redhen_contact'] array.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikemccaffrey created an issue. See original summary.

mikemccaffrey’s picture

This patch should solve the problem.

gcb’s picture

Good find. @wxactly found the same issue and has this more thorough cleanup.

  • gcb committed 9dc5d2f on 7.x-1.x authored by wxactly
    Issue #2711981 by mikemccaffrey: Contact upsert not getting existing...
gcb’s picture

Status: Active » Fixed

Fixed in dev.

Status: Fixed » Closed (fixed)

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