From b1106e394efb05de9cbdaee8738d2dd128109eb6 Mon Sep 17 00:00:00 2001 From: eileen <emcnaughton@wikimedia.org> Date: Wed, 16 Sep 2020 12:52:52 +1200 Subject: [PATCH] dev/core#2039 Set is_primary to 1 on email, address for domain contacts I'm digging into the places where the code handles is_primary due to duplicate handling/ queries - see https://lab.civicrm.org/dev/core/-/issues/2039 One distraction is that the domain contact's address & email are not marked is_primary. This doesn't make sense to me as they ARE a contact in the DB --- sql/test_data_second_domain.mysql | 4 ++-- xml/templates/civicrm_data.tpl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/test_data_second_domain.mysql b/sql/test_data_second_domain.mysql index c9dd5008dac..02be43b1922 100644 --- a/sql/test_data_second_domain.mysql +++ b/sql/test_data_second_domain.mysql @@ -10,13 +10,13 @@ SELECT @addId := id from civicrm_address where street_address = '15 Main St'; INSERT INTO civicrm_email (contact_id, location_type_id, email, is_primary, is_billing, on_hold, hold_date, reset_date) VALUES - (@contactID, 1, '"Domain Email" <domainemail2@example.org>', 0, 0, 0, NULL, NULL); + (@contactID, 1, 'domainemail2@example.org', 1, 0, 0, NULL, NULL); SELECT @emailId := id from civicrm_email where email = 'domainemail2@example.org'; INSERT INTO civicrm_phone (contact_id, location_type_id, is_primary, is_billing, mobile_provider_id, phone, phone_type_id) VALUES - (@contactID, 1, 0, 0, NULL,'204 555-1001', 1); + (@contactID, 1, 1, 0, NULL,'204 555-1001', 1); SELECT @phoneId := id from civicrm_phone where phone = '204 555-1001'; diff --git a/xml/templates/civicrm_data.tpl b/xml/templates/civicrm_data.tpl index ee4fae30c0c..a65d033c71e 100644 --- a/xml/templates/civicrm_data.tpl +++ b/xml/templates/civicrm_data.tpl @@ -33,7 +33,7 @@ SET @contactID := LAST_INSERT_ID(); INSERT INTO civicrm_email (contact_id, location_type_id, email, is_primary, is_billing, on_hold, hold_date, reset_date) VALUES -(@contactID, 1, 'fixme.domainemail@example.org', 0, 0, 0, NULL, NULL); +(@contactID, 1, 'fixme.domainemail@example.org', 1, 0, 0, NULL, NULL); INSERT INTO civicrm_domain (name, version, contact_id) VALUES (@domainName, '2.2', @contactID); SELECT @domainID := id FROM civicrm_domain where name = 'Default Domain Name'; -- GitLab