From 9069085b25661110cbb49006eec63742ac20c6cb Mon Sep 17 00:00:00 2001 From: Luciano Spiegel Date: Mon, 14 Jun 2021 16:48:31 +0200 Subject: [PATCH] force cleanup of setting value type "checkboxes" when is empty --- CRM/Admin/Form/SettingTrait.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CRM/Admin/Form/SettingTrait.php b/CRM/Admin/Form/SettingTrait.php index 4d96dcc6c6..21cad1f64b 100644 --- a/CRM/Admin/Form/SettingTrait.php +++ b/CRM/Admin/Form/SettingTrait.php @@ -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; } -- 2.25.1