Skip to content
Snippets Groups Projects
Unverified Commit e343d424 authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #20600 from ixiam/dev#SettingsTraitCheckboxes

Force cleanup of setting value type "checkboxes" when is empty
parents 2beecf9e 9069085b
Branches
Tags
No related merge requests found
......@@ -85,9 +85,13 @@ trait CRM_Admin_Form_SettingTrait {
// Handle quickform hateability just once, right here right now.
$unsetValues = array_diff_key($this->_settings, $params);
foreach ($unsetValues as $key => $unsetValue) {
if ($this->getQuickFormType($this->getSettingMetadata($key)) === 'CheckBox') {
$quickFormType = $this->getQuickFormType($this->getSettingMetadata($key));
if ($quickFormType === 'CheckBox') {
$setValues[$key] = [$key => 0];
}
elseif ($quickFormType === 'CheckBoxes') {
$setValues[$key] = [];
}
}
return $setValues;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment