Body: <p>We have on a Ubuntu 18.04LTS server, Drupal 7.63 (latest) with CiviCRM 5.7, PHP 7.1.20, MySQL 5.7.23.</p>
  
  <p>We have a profile form called <em>User Profile</em> that is only used for <em>View/Edit Drupal User Account</em>.  All users are synced with CiviCRM so that we can allow our website users to keep their details and preferences up to date and this works perfectly using this profile.</p>
  
  <p>In order to have additional custom fields for a particular type of individual, we have a single additional contact sub-type, based on Individual.  The vast majority of our contact records are not of this sub-type.  </p>
  
  <p>We've just noticed an issue whereby when an individual updates their profile after they log in on our website, <strong>their contact sub-type is also changed on their CiviCRM record</strong> along with any other changes that are fine (e.g. their address).  The changing of the sub-type <strong>is not</strong> accessible from this profile form; the only way to change it is to log in as an admin and edit a contact's record.</p>
  
  <p>I can reproduce this with just a save and with no details actually changed at all.</p>
  
  <p>I am going to try and get a more detailed understanding of this by setting up a test site and going through the debugger, but I wondered if anyone else has seen this behaviour? As you can imagine, it's quite serious.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-04T18:24:56.427Z
Comments.Text: I don't quite follow. Do you have the sub-type custom field on that Profile? I just replicated this on dmaster. Ie the user had a contact type Individual. I added a sub-contact type field to the Profile. Submitting the profile resulted in the contact type being changed - example is here until site refreshes - https://dmaster.demo.civicrm.org/civicrm/contact/view?reset=1&cid=203
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-04T18:27:23.233Z
Comments.Text: @petednz-fuzion my reading is that the contact subtype is NOT present as a profile field.
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-04T18:31:36.560Z
Comments.Text: can you pls add screenshots of the Profile which might clarify this point
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-13T21:59:31.887Z
Comments.Text: I'll sanitise some data and post a screen shot.  We do have custom fields that are linked to the contact subtype, but this is not the issue.  The actual subtype of the individual changes.
Comments.UserDisplayName: ChumKui
Tags: <drupal><profile>
Title: Bug in Drupal Profile for CiviCRM
ThreadText: # Bug in Drupal Profile for CiviCRM
  
  (Asked by: username_0 on 2019-02-04)
  
  We have on a Ubuntu 18.04LTS server, Drupal 7.63 (latest) with CiviCRM 5.7, PHP 7.1.20, MySQL 5.7.23.
  
  We have a profile form called *User Profile* that is only used for *View/Edit Drupal User Account*. All users are synced with CiviCRM so that we can allow our website users to keep their details and preferences up to date and this works perfectly using this profile.
  
  In order to have additional custom fields for a particular type of individual, we have a single additional contact sub-type, based on Individual. The vast majority of our contact records are not of this sub-type.
  
  We've just noticed an issue whereby when an individual updates their profile after they log in on our website, **their contact sub-type is also changed on their CiviCRM record** along with any other changes that are fine (e.g. their address). The changing of the sub-type **is not** accessible from this profile form; the only way to change it is to log in as an admin and edit a contact's record.
  
  I can reproduce this with just a save and with no details actually changed at all.
  
  I am going to try and get a more detailed understanding of this by setting up a test site and going through the debugger, but I wondered if anyone else has seen this behaviour? As you can imagine, it's quite serious.
  
  **Tags:** drupal, profile
  
  > **Comments:**
  > **username_1**: I don't quite follow. Do you have the sub-type custom field on that Profile? I just replicated this on dmaster. Ie the user had a contact type Individual. I added a sub-contact type field to the Profile. Submitting the profile resulted in the contact type being changed - example is here until site refreshes - https://dmaster.demo.civicrm.org/civicrm/contact/view?reset=1&cid=203  
  > **username_2**: @petednz-fuzion my reading is that the contact subtype is NOT present as a profile field.  
  > **username_1**: can you pls add screenshots of the Profile which might clarify this point  
  > **username_0**: I'll sanitise some data and post a screen shot.  We do have custom fields that are linked to the contact subtype, but this is not the issue.  The actual subtype of the individual changes.  
  
  ---
  
  ## 0 answers
  
  