Answers.Body: <p>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.</p>
  
  <p>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.</p>
  
  <p>This doesn't answer your 'how do we fix it' but might explain how to avoid the error showing to users.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-18T19:18:34.117Z
Answers.LastActivityDate: 2016-04-18T19:18:34.117Z
Answers.UserDisplayName: petednz - fuzion
Body: <p>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:</p>
  
  <pre><code>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).
  </code></pre>
  
  <p>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.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-03-31T15:19:03.103Z
Comments.Text: 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
Comments.UserDisplayName: Cheryl
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-03-31T15:32:41.993Z
Comments.Text: 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?
Comments.UserDisplayName: Cheryl
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-01T23:54:02.837Z
Comments.Text: what CMS are you using?
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-03T00:58:29.220Z
Comments.Text: We are using Drupal 7
Comments.UserDisplayName: Cheryl
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-03T05:50:17.957Z
Comments.Text: can you clarify what you mean by the 'main profile page' by pasting the end part of the url? we talking /user?
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-04T00:36:08.927Z
Comments.Text: Main profile administration page, e.g. : civicrm/admin/uf/group?reset=1
Comments.UserDisplayName: Cheryl
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-04T00:36:40.957Z
Comments.Text: Which results in this link provided: civicrm/profile/create?gid=1&reset=1
Comments.UserDisplayName: Cheryl
Tags: <drupal><profile><4.7><issues>
Title: Using Profiles for Data Entry
ThreadText: # Using Profiles for Data Entry
  
  (Asked by: username_0 on 2016-03-29)
  
  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.
  
  **Tags:** drupal, profile, 4.7, issues
  
  > **Comments:**
  > **username_0**: 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  
  > **username_0**: 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?  
  > **username_1**: what CMS are you using?  
  > **username_0**: We are using Drupal 7  
  > **username_1**: can you clarify what you mean by the 'main profile page' by pasting the end part of the url? we talking /user?  
  > **username_0**: Main profile administration page, e.g. : civicrm/admin/uf/group?reset=1  
  > **username_0**: Which results in this link provided: civicrm/profile/create?gid=1&reset=1  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-04-18. Score: 3
  
  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.
  
  
  ---
  
  