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

Fix bug in primary handling where TRUE rather than 1 used #18598

Merged
merged 1 commit into from
Sep 26, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Sep 25, 2020

Overview

Fixes a bug where ensuring valid primary addresses relies on is_primary being 1 or 0 but NOT TRUE of FALSE

Before

Updating a phone (etc) results in other phones for the contact being updated to is_primary = 0

civicm_api3('Phone', 'create', ['is_primary' => 1, 'id' => 50);

but this does not

civicm_api3('Phone', 'create', ['is_primary' => TRUE, 'id' => 50);

After

Both variants trigger is_primary cycle.

Technical Details

When a phone (etc) is updated to have is_primary = 1 then all the other phones for that contact should be is-primary = 0

Comments

@colemanw Note apiv4 still bypasses primary handling, for address at least

@civibot
Copy link

civibot bot commented Sep 25, 2020

(Standard links)

@civibot civibot bot added the master label Sep 25, 2020
@eileenmcnaughton eileenmcnaughton changed the title Fix bug inn primary handling where TRUE rather than 1 used Fix bug in primary handling where TRUE rather than 1 used Sep 25, 2020
@colemanw
Copy link
Member

This looks reasonable to me.

@colemanw colemanw merged commit d9c113b into civicrm:master Sep 26, 2020
@colemanw colemanw deleted the prim branch September 26, 2020 02:32
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