From 89e9faac98c166912443c37c6621d8ee6741aaaa Mon Sep 17 00:00:00 2001 From: Samuel Vanhove Date: Wed, 18 Oct 2023 17:59:59 -0400 Subject: [PATCH] dev/core#4703 edit with no parents crash --- CRM/Group/Form/Edit.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CRM/Group/Form/Edit.php b/CRM/Group/Form/Edit.php index 7f615f322e..ebc9dd8a88 100644 --- a/CRM/Group/Form/Edit.php +++ b/CRM/Group/Form/Edit.php @@ -412,7 +412,9 @@ WHERE title = %1 if (isset($form->_id)) { $potentialParentGroupIds = CRM_Contact_BAO_GroupNestingCache::getPotentialCandidates($form->_id, $groupNames); // put back current groups because they are selected by default - $potentialParentGroupIds = array_merge($potentialParentGroupIds, $parentGroupIds); + if (!empty($parentGroupIds)) { + $potentialParentGroupIds = array_merge($potentialParentGroupIds, $parentGroupIds); + } } else { $potentialParentGroupIds = array_keys($groupNames); -- 2.25.1