Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#2039 Set is_primary to 1 on email, address for domain contacts #18480

Merged
merged 2 commits into from
Sep 16, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

dev/core#2039 Set is_primary to 1 on email, address for domain contacts (on new & test installs)

Before

New installs have a contact record for the domain organization. It has an email but the sql that inserts that email uses is_primary = 0

After

New installs have a contact record for the domain organization whose email is marked is_primary

Technical Details

I'm digging into the places where the code handles is_primary due to duplicate handling/ queries

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

Comments

@seamuslee001 if you think this is straightforward I'l regen the sql & add it in

@civibot
Copy link

civibot bot commented Sep 16, 2020

(Standard links)

@civibot civibot bot added the master label Sep 16, 2020
@@ -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, '"Domain Email" <domainemail2@example.org>', 1, 0, 0, NULL, NULL);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that a valid email?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the question

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh - you mean the part I didn't change looks weird - yeah it does

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more like that doesn't seem to be a correct data for that column like that looks more appropriate for the option_value.value rather than civicrm_email

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah - I can change that to just the email & add in the regen update if this is otherwise ok

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seamuslee001 unrelated test fail - but I've fixed ^^ & grabbed in the regenerate sql commit

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
@eileenmcnaughton
Copy link
Contributor Author

Thanks @seamuslee001 - I'll try the tests again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants