1

My registrations are failing miserably and it's making me crazy. I can see that some values are being passed to contact profiles, but the users aren't being registered.

I'm on CentOS 7.x, PHP 7.2 with WP 5.2.2 and Civi 5.13.4.

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}

I have collected the first and last names as well as email. I'm not sure where to define the display_name and where I should be passing it. Any help and guidance is appreciated.

2 Answers 2

2

This was my own confusion and I had help from the CF-CiviCRM author. Great support there.

The problem was related to conditional statements in the form. I had created conditions for the appearance of all the contacts in a multi-contact form, but I hadn't applied conditions to processors.

I had assumed that the conditions related to the show/hide fields were inherited by processors. That's not the case. Instead, each contact processor had to have its own conditions applied to the group of fields.

For example. Only process the second contact group if First Name 2 is %first_name_2%. In other words, if the first name of the 2nd contact is blank, don't process that contact group. This is regardless of whether the conditions allow visibility for that contact. The visibility rules were not applied to the processing of the group.

Lesson learned, and maybe someone else will benefit from my experience.

0

Not sure what the exact error is, but to explain the backtrace mentioned above, it seems the contact create api is failing for some reason.

I have collected the first and last names as well as email. I'm not sure where to define the display_name and where I should be passing it. Any help and guidance is appreciated.

It is not that civi api is expecting a valid value for display_name. The API is returning an error because it is not able to find any of the value sent from the CF to process and create a contact in civi. If any of the value from first_name, last_name, email, display_name is retrieved correctly by the api, the contact will be created without any error.

So make sure user enters a valid value for first name, last name or email field on the form OR make email as a required field, enable "Process email for this contact." in contact config, etc.

1
  • I believe the name and email fields are already required, along with a handful of others for this event processing. I will double check though. I also have some feedback from github that CF-Civicrm may be looking for values for every field in the form processor, whether I've collected it or not. I will be testing that shortly. Thanks for the input though. I'll make another pass through all my previous checks, just in case I've missed something. Aug 23, 2019 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.