From 0c3739289aecfc809c1d4abf300ccf734ea4a6ab Mon Sep 17 00:00:00 2001 From: chiachin Date: Tue, 12 Nov 2024 17:28:46 +0800 Subject: [PATCH] Refs #41997, Fix type check for customValue to handle non-array input in CheckBox field. --- CRM/Core/BAO/CustomGroup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Core/BAO/CustomGroup.php b/CRM/Core/BAO/CustomGroup.php index f7a1386fd..16822d38f 100644 --- a/CRM/Core/BAO/CustomGroup.php +++ b/CRM/Core/BAO/CustomGroup.php @@ -1261,7 +1261,7 @@ static function postProcess(&$groupTree, &$params, $skipFile = FALSE) { case 'CheckBox': if (!empty($v)) { - $customValue = array_keys($v); + $customValue = is_array($v) ? array_keys($v) : []; $groupTree[$groupID]['fields'][$fieldId]['customValue']['data'] = CRM_Core_DAO::VALUE_SEPARATOR . CRM_Utils_Array::implode(CRM_Core_DAO::VALUE_SEPARATOR, $customValue) . CRM_Core_DAO::VALUE_SEPARATOR; } else {