From 688c9746dde612837d384651ef9e787f3257d1b9 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sat, 7 Aug 2021 12:37:53 +1200 Subject: [PATCH] dev/core#2742 fix group type on group create from form --- CRM/Contact/Form/Task/AddToGroup.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/CRM/Contact/Form/Task/AddToGroup.php b/CRM/Contact/Form/Task/AddToGroup.php index 5385ed1fc7..b1964c7362 100644 --- a/CRM/Contact/Form/Task/AddToGroup.php +++ b/CRM/Contact/Form/Task/AddToGroup.php @@ -181,14 +181,7 @@ class CRM_Contact_Form_Task_AddToGroup extends CRM_Contact_Form_Task { $groupParams['title'] = $params['title']; $groupParams['description'] = $params['description']; $groupParams['visibility'] = "User and User Admin Only"; - if (array_key_exists('group_type', $params) && is_array($params['group_type'])) { - $groupParams['group_type'] = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR, - array_keys($params['group_type']) - ) . CRM_Core_DAO::VALUE_SEPARATOR; - } - else { - $groupParams['group_type'] = ''; - } + $groupParams['group_type'] = array_keys($params['group_type'] ?? []); $groupParams['is_active'] = 1; $createdGroup = CRM_Contact_BAO_Group::create($groupParams); -- 2.25.1