dev/core#2459 Fix custom fields changed from multiple-choice data type to Text #19794
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://lab.civicrm.org/dev/core/-/issues/2459
Overview
Changing a custom field from a multiple choice (Radio, Checkboxes, etc.) to a free-entry text box works, until you try to write to the custom field via the API.
Reproduction steps are on the ticket.
Before
API Error - your value isn't an accepted value for this field.
After
A custom field with a data type of "String" and HTML type of "Text" should take any alphanumeric value.
Technical Details
Changing the HTML type doesn't remove the Option Group ID. While arguably the API code should ignore that, it seems more important that the data be correct.