I have a simple form to create a mailing list for an event. The form only has one field, an email address which is setup to attach to a group. When I use the form for an existing user it works as intended. However when attempting to use a new email address nothing happens and I get the following errors:

The CiviCRM "contact create" API function returned the error: "Mandatory key(s) missing from params array: one of (first_name, last_name, email, display_name)" when called by line 644 of webform_civicrm_forms.inc with the following parameters: "Array ( [contact_type] => Individual [contact_sub_type] => [source] => TNG International Camp [check_permissions] => [version] => 3 )

Any assistance would be greatly appreciated

Comments

rigel8806’s picture

Sorry about the bad spelling above, been up too long. In addition to the above error I also get this one:

Deprecated function: Call-time pass-by-reference has been deprecated in module_load_include() (line 302 of /home/eros/public_html/hedone.us/public/includes/module.inc).

colemanw’s picture

Status: Active » Fixed

Ok, I believe I've fixed it. Please report back here after testing. :)

PS: Having so little info about a contact in your db is something you may come to regret :P

rigel8806’s picture

I wouldn't normally, but it's a special use case. Just updated to dev, still getting the same two errors.

rigel8806’s picture

Status: Fixed » Active
rigel8806’s picture

php 08/31/2012 - 1:38am Deprecated function: Call-time pass-by-reference has... rigel
webform_civicrm 08/31/2012 - 1:38am The CiviCRM "contact create" API function returned... rigel

colemanw’s picture

Drupal.org takes up to 12 hrs to create a dev. If you want to test something immediately, you have to clone it from git.
But by now it should be in dev.

rigel8806’s picture

Pulled the git, still having the same problem. Is there something special I need to set???

colemanw’s picture

I just tested it myself. Creating a contact with only an email address works fine.
I am still seeing the php notice though, and not sure why... it's kind of baffling.

rigel8806’s picture

Ok. I got it to work by itself, but strangely enough it does not work with a Nick Name field

colemanw’s picture

Ah, yes well your original error message did suggest that nick_name would not satisfy the minimum field requirements. I wonder if that's for real or if the api is just being too picky.

Tell you what, I'll look into that if you'll look into the deprecated notice. Cause I just spent all afternoon trying to track that one down and ended up with zilch. All I can tell you is:

-It only happens when this module is installed
-It only happens when the form does not contain an existing_contact component
-The problem is not in contact_component.inc
-It is not actually originating from module_load_include() so PHPs error message is wrong - but that may be because the offending behavior is happening when an include file gets parsed (but which one???)

colemanw’s picture

FOUND IT!
HA!

rigel8806’s picture

LOL, that's probably good. I would have been happy to help, however my knowledge of php is somewhat limited.

rigel8806’s picture

What I find interesting is that your fix allows an email only without a name, however somehow adding a nick name kills the fix.

colemanw’s picture

Yep, actually it makes perfect sense - I had assumed that nick_name would satisfy Civi's minimum requirements to create a contact, (and so wasn't doing the same fix as when there's just email) but it does not. I can fix it in a bit.

rigel8806’s picture

Thanks. That would be outstanding.

BTW. I can honestly say this is the best maintained module I have used in terms of issue resolution.

colemanw’s picture

Title: Cannot Create Contact » Cannot Create Contact with only Email
Status: Active » Fixed

OK, fixed. Please let me know results of your testing :)

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Sleep-deprived spelling