From 38945728a01fb6d51a9234946eb962cbe2fbbf80 Mon Sep 17 00:00:00 2001 From: Samuel Vanhove Date: Thu, 11 May 2023 14:28:40 -0400 Subject: [PATCH] Deal with group update without any parent --- CRM/Contact/BAO/Group.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/BAO/Group.php b/CRM/Contact/BAO/Group.php index 138bc13988..7c6df47a41 100644 --- a/CRM/Contact/BAO/Group.php +++ b/CRM/Contact/BAO/Group.php @@ -372,8 +372,11 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { } // get current parents for removal if not in the list anymore + $currentParentGroupIDs = []; $parents = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $params['id'], 'parents'); - $currentParentGroupIDs = explode(',', $parents); + if (!empty($parents)) { + $currentParentGroupIDs = explode(',', $parents); + } } // form the name only if missing: CRM-627 -- 2.25.1