Answers.Body: <p>You mention that you see this error on the production version as well.  This indicates that your production site is displaying errors, which is a PHP misconfiguration.  There are many <a href="https://stackoverflow.com/questions/332178/best-way-to-suppress-php-errors-on-production-servers">similar questions</a> on Stack Overflow on setting PHP error reporting, but the best reference is the <a href="http://php.net/manual/en/function.error-reporting.php" rel="nofollow noreferrer">error reporting page of the PHP manual</a>.</p>
  
  <p>This doesn't solve the underlying issue, but it will hide the messages in production.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-31T09:54:37.980Z
Answers.Text: The problem occurs in the production version only in the drupal log.
Answers.UserDisplayName: Marcin Lewandowski
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-31T15:55:21.110Z
Answers.Text: Ah, OK!  I'd like to help you - I'm a former EMT (ambulance worker) and now I'm a CiviCRM developer.  In the question you say that any participant registered to the event is automatically entered as a contact subtype.  How do you do that?  Is that custom code?
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-01T00:00:32.010Z
Answers.Text: Fantastic! Perfect fit for the activities of our foundation :)
  (Sorry, my English is not very good, I use translator and correct his mistakes as far as I can :))
  
  In the registration form, I used the additional fields assigned to the subtype "Uczestnik" only. Now that I've removed the specific fields for this subtype, the problem still occurs (the person added as a "contact" type).
  
  I can create a user account for you if needed.
Answers.UserDisplayName: Marcin Lewandowski
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-31T04:49:37.480Z
Answers.LastActivityDate: 2017-08-31T04:49:37.480Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>My CiviCRM version is: 4.7.23, Drupal: 7.56, PHP: 7.0
  I have trouble with CiviEVENT. When participant fill and sendregistration form for event (when he doesnt exist in database) in CiviCRM i see this error:</p>
  
  <blockquote>
    <p>Notice: Undefined index: contact_sub_type w CRM_Contact_BAO_Contact::formatProfileContactParams() (linia 2010 z /home/sol/domains/staroflife.hekko24.pl/public_html/dev/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php).</p>
    
    <blockquote>
      <p>Warning: in_array() expects parameter 2 to be array, null given w CRM_Contact_BAO_Contact::formatProfileContactParams() (linia 2011 z /home/sol/domains/staroflife.hekko24.pl/public_html/dev/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php).</p>
      
      <blockquote>
        <p>Notice: Undefined index: contact_sub_type w CRM_Contact_BAO_Contact::formatProfileContactParams() (linia 2013 z /home/sol/domains/staroflife.hekko24.pl/public_html/dev/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php).</p>
      </blockquote>
    </blockquote>
  </blockquote>
  
  <p>CiviCRM did not show this error before updating CiviCRM. I will add that the participant registered to the event is automatically entered as a "Uczestnik (eng. participant)" contact subtype, configured as a contact.</p>
  
  <p>The contact created in the database has a properly assigned contact type, but this annoying error appears.</p>
  
  <p>You can reproduce the error trying to subscribe to the event at: dev.staroflife.hekko24.pl (developer and testing environment)
  1. Select one of the events at the bottom of the page and click "register now"
  2. Enter your data in the form
  3. As a payment option select "płacę z dotpay"
  4. In the payment test environment, select any method, accept, and click the payment solution as Accept.
  5. When you return to CiviCRM you should see this error.</p>
  
  <p>This same error i see in production version :(.</p>
  
Tags: <civievent><drupal><sub-types>
Title: Civievents - warning when user registers for event (CiviCRM 4.7.23)
ThreadText: # Civievents - warning when user registers for event (CiviCRM 4.7.23)
  
  (Asked by: username_0 on 2017-08-30)
  
  My CiviCRM version is: 4.7.23, Drupal: 7.56, PHP: 7.0
  I have trouble with CiviEVENT. When participant fill and sendregistration form for event (when he doesnt exist in database) in CiviCRM i see this error:
  
  > Notice: Undefined index: contact\_sub\_type w CRM\_Contact\_BAO\_Contact::formatProfileContactParams() (linia 2010 z /home/sol/domains/staroflife.hekko24.pl/public\_html/dev/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php).
  >
  > > Warning: in\_array() expects parameter 2 to be array, null given w CRM\_Contact\_BAO\_Contact::formatProfileContactParams() (linia 2011 z /home/sol/domains/staroflife.hekko24.pl/public\_html/dev/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php).
  > >
  > > > Notice: Undefined index: contact\_sub\_type w CRM\_Contact\_BAO\_Contact::formatProfileContactParams() (linia 2013 z /home/sol/domains/staroflife.hekko24.pl/public\_html/dev/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php).
  
  CiviCRM did not show this error before updating CiviCRM. I will add that the participant registered to the event is automatically entered as a "Uczestnik (eng. participant)" contact subtype, configured as a contact.
  
  The contact created in the database has a properly assigned contact type, but this annoying error appears.
  
  You can reproduce the error trying to subscribe to the event at: dev.staroflife.hekko24.pl (developer and testing environment)
  1. Select one of the events at the bottom of the page and click "register now"
  2. Enter your data in the form
  3. As a payment option select "płacę z dotpay"
  4. In the payment test environment, select any method, accept, and click the payment solution as Accept.
  5. When you return to CiviCRM you should see this error.
  
  This same error i see in production version :(.
  
  **Tags:** civievent, drupal, sub-types
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-08-31. Score: 0
  
  You mention that you see this error on the production version as well. This indicates that your production site is displaying errors, which is a PHP misconfiguration. There are many [similar questions](https://stackoverflow.com/questions/332178/best-way-to-suppress-php-errors-on-production-servers) on Stack Overflow on setting PHP error reporting, but the best reference is the [error reporting page of the PHP manual](http://php.net/manual/en/function.error-reporting.php).
  
  This doesn't solve the underlying issue, but it will hide the messages in production.
  
  > **Comments:**
  > **username_0**: The problem occurs in the production version only in the drupal log.  
  > **username_1**: Ah, OK!  I'd like to help you - I'm a former EMT (ambulance worker) and now I'm a CiviCRM developer.  In the question you say that any participant registered to the event is automatically entered as a contact subtype.  How do you do that?  Is that custom code?  
  > **username_0**: Fantastic! Perfect fit for the activities of our foundation :) (Sorry, my English is not very good, I use translator and correct his mistakes as far as I can :))  In the registration form, I used the additional fields assigned to the subtype "Uczestnik" only. Now that I've removed the specific fields for this subtype, the problem still occurs (the person added as a "contact" type).  I can create a user account for you if needed.  
  
  ---
  
  