Answers.Body: <p>That sounds like a bug - can you confirm you ran the import via the CiviCRM GUI?</p>
  
  <p>On fixing this for you - do you have access (or work with someone) who has - to phpMyAdmin or MySQL?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-07T15:17:28.653Z
Answers.Text: Yes, I was using the CiviCRM GUI (4.7.14). I personally do not have access to phpMyAdmin or MySQL, but somebody else almost definitely has.
Answers.UserDisplayName: janisr
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-07T14:35:38.273Z
Answers.LastActivityDate: 2017-08-07T14:35:38.273Z
Answers.UserDisplayName: KarinG - Semper IT
Answers.Body: <p>I've had the this same issue for at least a couple years now. I created this extension to "fix" the issue. It looks for related records (phone,email,address) of a contact and when none, or more than one are set to primary it sets just one to primary. Uses the sites default location type for primary.</p>
  
  <p><a href="https://github.com/proexchange/com.pesc.primaryfix" rel="nofollow noreferrer">https://github.com/proexchange/com.pesc.primaryfix</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-09T16:12:16.850Z
Answers.Text: Hi Jose - have you seen https://github.com/eileenmcnaughton/org.wikimedia.datachecks?  It seems like it covers some similar ground.  Thoughts?
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-08T19:06:51.907Z
Answers.LastActivityDate: 2019-10-08T19:06:51.907Z
Answers.UserDisplayName: Jose Torres
Body: <p>We want to update a bunch of contacts with e-mail adresses and phone numbers, for which previously these did not exist. The import works fine, as a result the contacts now have a Home (for example) e-mail and phone, but these are not set as the Primary ones. Because of this, the new e-mails and phone numbers do not show up in reports, and cannot be used in contact search. Only when I view one of the updated contacts, click into the Email field and then, without changing anything, press Save, the email is set to Primary.</p>
  
  <p>It appears that when the contact is first created, in case there is no e-mail or phone, the Primary flag is not set. During contact update, the address/phone is updated, but the Primary flag is left missing. Is it possible to set the e-mail and phone to Primary during import if these did not exist previously?</p>
  
  <p>We're currently using CiviCRM 4.7.14.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-07T14:37:25.743Z
Comments.Text: What CMS are you using?
Comments.UserDisplayName: KarinG - Semper IT
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-07T14:48:57.447Z
Comments.Text: Could you please edit your question to let us know the version of CiviCRM you're running? Does the problem happen when you try to replicate it at http://dmaster.demo.civicrm.org/?
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-07T15:25:00.533Z
Comments.Text: Yes, I can verify that the issue can be replicated on the demo site.
Comments.UserDisplayName: janisr
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-27T10:11:36.020Z
Comments.Text: Connected JIRA issue: https://issues.civicrm.org/jira/browse/CRM-21081
Comments.UserDisplayName: Aivars
Tags: <import><primary>
Title: Setting primary email and phone upon contact update
ThreadText: # Setting primary email and phone upon contact update
  
  (Asked by: username_0 on 2017-08-07)
  
  We want to update a bunch of contacts with e-mail adresses and phone numbers, for which previously these did not exist. The import works fine, as a result the contacts now have a Home (for example) e-mail and phone, but these are not set as the Primary ones. Because of this, the new e-mails and phone numbers do not show up in reports, and cannot be used in contact search. Only when I view one of the updated contacts, click into the Email field and then, without changing anything, press Save, the email is set to Primary.
  
  It appears that when the contact is first created, in case there is no e-mail or phone, the Primary flag is not set. During contact update, the address/phone is updated, but the Primary flag is left missing. Is it possible to set the e-mail and phone to Primary during import if these did not exist previously?
  
  We're currently using CiviCRM 4.7.14.
  
  **Tags:** import, primary
  
  > **Comments:**
  > **username_1**: What CMS are you using?  
  > **username_2**: Could you please edit your question to let us know the version of CiviCRM you're running? Does the problem happen when you try to replicate it at http://dmaster.demo.civicrm.org/?  
  > **username_0**: Yes, I can verify that the issue can be replicated on the demo site.  
  > **username_3**: Connected JIRA issue: https://issues.civicrm.org/jira/browse/CRM-21081  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2017-08-07. Score: 3
  
  That sounds like a bug - can you confirm you ran the import via the CiviCRM GUI?
  
  On fixing this for you - do you have access (or work with someone) who has - to phpMyAdmin or MySQL?
  
  > **Comments:**
  > **username_0**: Yes, I was using the CiviCRM GUI (4.7.14). I personally do not have access to phpMyAdmin or MySQL, but somebody else almost definitely has.  
  
  ---
  
  ### Answer by username_4 on 2019-10-08. Score: 0
  
  I've had the this same issue for at least a couple years now. I created this extension to "fix" the issue. It looks for related records (phone,email,address) of a contact and when none, or more than one are set to primary it sets just one to primary. Uses the sites default location type for primary.
  
  <https://github.com/proexchange/com.pesc.primaryfix>
  
  > **Comments:**
  > **username_2**: Hi username_4 - have you seen https://github.com/eileenmcnaughton/org.wikimedia.datachecks?  It seems like it covers some similar ground.  Thoughts?  
  
  ---
  
  