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 obscure bug on updating custom fields (not necessarily hittable via UI) #14754

Merged
merged 2 commits into from
Jul 9, 2019

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Fixes a scenario where updating a custom field via the api fails - I think this can't be replicated in the uI

Before

If a custom group has no value in option_group_id and an api update adds one it fails (replicated in the test)

After

Succeeds

Technical Details

This fixes a bug which I think only applies to programatically created custom fields -basically if the field has an empty option_group_id
and then you update it to have one it does a check to see if the existing option_group_id is in use and does not handle the
fact the field is empty - leading to a mysql error.

Comments

The formatting commit is separately in #14753 - if that is merged first will rebase out

@civibot
Copy link

civibot bot commented Jul 8, 2019

(Standard links)

@civibot civibot bot added the master label Jul 8, 2019
…ia UI)

This fixes a bug which I think only applies to programatically created custom fields -basically if the field has an empty option_group_id
and then you update it to have one it does a check to see if the existing option_group_id is in use and does not handle the
fact the field is empty - leading to a mysql error.
@eileenmcnaughton
Copy link
Contributor Author

test this please

@colemanw colemanw merged commit 68ca2fb into civicrm:master Jul 9, 2019
@colemanw
Copy link
Member

colemanw commented Jul 9, 2019

Merging based on code review & passing tests.

@colemanw colemanw deleted the cust_field_fix branch July 9, 2019 02:54
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.

2 participants