Body: <p>I just did an import (to verify weird behavior reported by a client), matching on first, last and email, with Update checked.
  The system has home set as default location type (=1).
  The contact had only one email and was set to "Govt" (a custom setting of location type =6) and since was the only email, was the primary.
  On import, with the email in the mapping set to Primary, the correct contact was matched, but the result was a duplicate email created of type Billing (=5).
  When inspecting the civicrm_email table the location_type_id=0 though (no setting for id=0)!</p>
  
  <p>The primary email setting was not changed for my test, but examining the detailed log tables for their import, timestamps show the primary email was changed from the existing primary to the newly created billing email simultaneously (again contact record shows billing, but civicrm_email table shows location_type_id=0)!</p>
  
  <p>Has anyone experienced this kind of behavior?  I would expect the primary email to be updated no matter what location type, no?</p>
  
  <p>Running Civi 4.7.23 in Drupal</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-06T19:07:43.790Z
Comments.Text: I seem to recall a discussion on this recently on Github.  Could you test against the dmaster demo and see if the problem exists in the master branch?
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-08T15:17:06.313Z
Comments.Text: Yes, the same thing happened on the demo site running 4.7.25 (duplicate billing email created and primary switched to billing) - can't see DB to check location_type_id
Comments.UserDisplayName: Karen S
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-08T17:38:27.287Z
Comments.Text: I think maybe you used a different demo site - I was thinking of http://dmaster.demo.civicrm.org.  If it happens *there*, then you should open a ticket on https://issues.civicrm.org with steps to replicate.
Comments.UserDisplayName: Jon G - Megaphone Tech
Tags: <import>
Title: Weird behavior when Importing into primary email
ThreadText: # Weird behavior when Importing into primary email
  
  (Asked by: username_0 on 2017-11-06)
  
  I just did an import (to verify weird behavior reported by a client), matching on first, last and email, with Update checked.
  The system has home set as default location type (=1).
  The contact had only one email and was set to "Govt" (a custom setting of location type =6) and since was the only email, was the primary.
  On import, with the email in the mapping set to Primary, the correct contact was matched, but the result was a duplicate email created of type Billing (=5).
  When inspecting the civicrm\_email table the location\_type\_id=0 though (no setting for id=0)!
  
  The primary email setting was not changed for my test, but examining the detailed log tables for their import, timestamps show the primary email was changed from the existing primary to the newly created billing email simultaneously (again contact record shows billing, but civicrm\_email table shows location\_type\_id=0)!
  
  Has anyone experienced this kind of behavior? I would expect the primary email to be updated no matter what location type, no?
  
  Running Civi 4.7.23 in Drupal
  
  **Tags:** import
  
  > **Comments:**
  > **username_1**: I seem to recall a discussion on this recently on Github.  Could you test against the dmaster demo and see if the problem exists in the master branch?  
  > **username_0**: Yes, the same thing happened on the demo site running 4.7.25 (duplicate billing email created and primary switched to billing) - can't see DB to check location_type_id  
  > **username_1**: I think maybe you used a different demo site - I was thinking of http://dmaster.demo.civicrm.org.  If it happens *there*, then you should open a ticket on https://issues.civicrm.org with steps to replicate.  
  
  ---
  
  ## 0 answers
  
  