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

APIv4 - Fix mishandling of boolean custom values #23970

Merged
merged 2 commits into from
Jul 21, 2022

Conversation

MegaphoneJon
Copy link
Contributor

@MegaphoneJon MegaphoneJon commented Jul 7, 2022

Overview

Fixes https://lab.civicrm.org/dev/core/-/issues/3497 to correctly save boolean custom field values.

Before

APIv4 would store FALSE as NULL.

After

Boolean fields correctly saved.

@civibot
Copy link

civibot bot commented Jul 7, 2022

(Standard links)

@civibot civibot bot added the master label Jul 7, 2022
@colemanw colemanw changed the title Test Only - show FALSE is stored as NULL on custom boolean fields APIv4 - Fix mishandling of boolean custom values Jul 8, 2022
@colemanw
Copy link
Member

colemanw commented Jul 8, 2022

@MegaphoneJon I've updated this PR with a fix. I wasn't sure if I should limit the fix to just custom fields, or if it was appropriate to convert every field. Considering how inconsistent our BAO code is, I think the blanket fix might prevent other edge-case bugs like this one so I've tried that and we'll see how the test suite likes it.

@seamuslee001
Copy link
Contributor

This seems fine to me and has a unit tests merging

@seamuslee001 seamuslee001 merged commit ef6a669 into civicrm:master Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants