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

Force cleanup of setting value type "checkboxes" when is empty #20600

Merged
merged 1 commit into from
Jul 8, 2021

Conversation

sluc23
Copy link
Contributor

@sluc23 sluc23 commented Jun 14, 2021

Overview

When using a custom setting of type checkboxes, if there's no checked value in the group, it's not saved empty in the DB

Before

Add a custom setting type checkboxes in you extension with multiple options, go to to Generic Admin Form, and save any value. Then go back and uncheck all the boxes, the empty value is not saved in the DB, previous value remains.

After

Empty value is saved in the DB; if there's no box checked in the Generic Admin Form

Technical Details

Looks like the setting type checkboxes is not fully supported in Civi yet, (as a single checkbox), probably more PRs coming after this one to add more features to this useful setting type

Comments

I haven't found many implementations of custom settings of type checkboxes in the community, but it's fully documented as part of settings MetaData in docs, but still needs some love in the source code to fully work as expected.

@civibot
Copy link

civibot bot commented Jun 14, 2021

(Standard links)

@civibot civibot bot added the master label Jun 14, 2021
@colemanw
Copy link
Member

colemanw commented Jul 6, 2021

I think this one could use your eye on it @eileenmcnaughton

@eileenmcnaughton
Copy link
Contributor

Thanks @sluc23 - this makes sense

@eileenmcnaughton eileenmcnaughton merged commit e343d42 into civicrm:master Jul 8, 2021
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