mecachisenros / cf-civicrm

Caldera Forms CiviCRM Integration
GNU Affero General Public License v3.0
30 stars 26 forks source link

Mandatory key(s) missing from params array: one of (first_name, last_name, email, display_name) #123

Closed lyonsdigital closed 5 years ago

lyonsdigital commented 5 years ago

I feel as if I'm missing the obvious, so I apologize in advance. I have a series of event registration forms that need to go up ASAP, but I'm getting the following error:

Mandatory key(s) missing from params array: one of (first_name, last_name, email, display_name)

0 /home/fpptaweb/public_html/wp-content/plugins/cf-civicrm/processors/contact/class-contact-processor.php(228): civicrm_api3('Contact', 'create', Array)

1 /home/fpptaweb/public_html/wp-content/plugins/caldera-forms/classes/core.php(3273): CiviCRM_Caldera_Forms_Contact_Processor->pre_processor(Array, Array, '_cf_process_5d5...')

2 /home/fpptaweb/public_html/wp-content/plugins/caldera-forms/classes/core.php(5203): Caldera_Forms::process_submission()

3 /home/fpptaweb/public_html/wp-content/plugins/caldera-forms/classes/core.php(3821): Caldera_Forms::process_form_via_post()

4 /home/fpptaweb/public_html/wp-includes/class-wp-hook.php(286): Caldera_Forms->cf_init_system('')

5 /home/fpptaweb/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)

6 /home/fpptaweb/public_html/wp-includes/plugin.php(465): WP_Hook->do_action(Array)

7 /home/fpptaweb/public_html/wp-settings.php(546): do_action('wp_loaded')

8 /home/fpptaweb/public_html/wp-config.php(88): require_once('/home/fpptaweb/...')

9 /home/fpptaweb/public_html/wp-load.php(37): require_once('/home/fpptaweb/...')

10 /home/fpptaweb/public_html/wp-blog-header.php(13): require_once('/home/fpptaweb/...')

11 /home/fpptaweb/public_html/index.php(17): require('/home/fpptaweb/...')

12 {main}

My test page is at https://fppta.org/?page_id=936&preview=1&cf_preview=CF5d4d7e489799a

I have first and last names as well as email defined but I don't see where display_name should be mapped, or even where it would come from. I assume this the display_name from WordPress, but that's as far as logic will take me. I really need the help and I need it soon. Every other error I encounter has made perfect sense, and I've debugged quite a bit so far, but this is an absolute show stopper.

I was going to make one connected form, but as someone else has noted, there's a problem saving the Caldera Connected Form. I didn't see solution until this morning when I was quite far along.

mecachisenros commented 5 years ago

@lyonsdigital please try to fill in all requested info when filling a bug.

The display name is not mandatory, so assuming you have mapped the form fields correctly I'm not sure what the issue is without having a look at the form configuration, export the form in json format and paste it/upload it here, or upload screenshots.

lyonsdigital commented 5 years ago

Here's the file that your requested. I had to change the file extension to post it. I'm also reviewing my fields. guest-fall-school-export.json.txt

lyonsdigital commented 5 years ago

I reviewed all my inputs and I don't believe that I've missed anything and I continue to get this same result.

mecachisenros commented 5 years ago

Right, this is not an issue with the plugin but your form configuration, from what I can gather it looks like you need to setup conditionals for the Contact processors which might not be processed (i.e. they are optional based on user input/selection), so that they are only used when their mapped fields are filled in (i.e not empty), so set the processor conditionals to only be used when Field Y is _%fieldy%.

lyonsdigital commented 5 years ago

Didn't mean to leave you hanging. That appears to be the fix. I'm moving forward through multiple deadlines. Thank you so much!