From ffbf85ecdc9705b2c98935030052243ac3ba5d61 Mon Sep 17 00:00:00 2001 From: larssandergreen Date: Tue, 13 Jun 2023 00:29:07 -0600 Subject: [PATCH] Don't add Contacts to Groups they are Added to on Edit --- CRM/Contact/Form/Contact.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php index e714c484a3..97f23f7f47 100644 --- a/CRM/Contact/Form/Contact.php +++ b/CRM/Contact/Form/Contact.php @@ -962,6 +962,10 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { if ((!array_key_exists($key['group_id'], $params['group']) || $params['group'][$key['group_id']] != 1) && empty($key['is_hidden'])) { $params['group'][$key['group_id']] = -1; } + // don't try to add to groups that the contact is already Added to + elseif (array_key_exists($key['group_id'], $params['group']) && $params['group'][$key['group_id']] == 1) { + unset($params['group'][$key['group_id']]); + } } } } -- 2.25.1