I am using profiles for data entry in my CiviCRM instance. They seem to be working (the contacts that should be created are saving), but I get the following (big ugly) notices at the top of the page on a save:

Notice: Undefined index: contact_sub_type in CRM_Contact_BAO_Contact::formatProfileContactParams() (line 2010 of /var/www/html/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php).
Warning: in_array() expects parameter 2 to be array, null given in CRM_Contact_BAO_Contact::formatProfileContactParams() (line 2011 of /var/www/html/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php).
Notice: Undefined index: contact_sub_type in CRM_Contact_BAO_Contact::formatProfileContactParams() (line 2012 of /var/www/html/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php).

The contact_sub_type_hidden is being submitted when the form is submitted with an appropriate value, so I'm at a bit of a loss as to why these errors are being thrown and what impact they have on what I'm doing. Any pointers appreciated.

  • Additional information - this can be reproduced on the CiviCRM demo site, so it looks like a bug in CiviCRM. Steps to reproduce: 1) Add to the name and address profile, a field (aka Job Title for the contact type "Student") and save 2) Use create mode from the fields page (this will pop the profile into the overlay) and submitting will work fine 3) use create mode from the main profile page (which does not send you into an overlay) and pushing submit produces the above errors
    – Cheryl
    Mar 31, 2016 at 15:19
  • Functionally, the data will submit, but is there a way to force the overlay behavior from a direct link so that the user does not see the ugly errors?
    – Cheryl
    Mar 31, 2016 at 15:32
  • what CMS are you using?
    – petednz - fuzion
    Apr 1, 2016 at 23:54
  • 1
    We are using Drupal 7
    – Cheryl
    Apr 3, 2016 at 0:58
  • can you clarify what you mean by the 'main profile page' by pasting the end part of the url? we talking /user?
    – petednz - fuzion
    Apr 3, 2016 at 5:50

1 Answer 1


In Drupal under Configuration > Development > Logging and Errors ie admin/config/development/logging you can set Errors and warnings to be 'off' and it is normal to do so on the production site, while leaving them showing on the development version.

The reason you don't see this on 'edit' but do on 'create' is, as you say, because Edit uses the overlay, but if you were to right click on the button instead and open in a new tab then I would expect the error is showing.

This doesn't answer your 'how do we fix it' but might explain how to avoid the error showing to users.

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.