Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | contact_upsert_fix-2711981-3.patch | 1.61 KB | gcb |
#2 | redhen-2711981-2-redhen_contact_upsert_get_existing.patch | 913 bytes | mikemccaffrey |
Comments
Comment #2
mikemccaffreyThis patch should solve the problem.
Comment #3
gcbGood find. @wxactly found the same issue and has this more thorough cleanup.
Comment #5
gcbFixed in dev.