From e3be8ef2f03846fb19ebe493760acf0c2f5d341f Mon Sep 17 00:00:00 2001
From: Seamus Lee <seamuslee001@gmail.com>
Date: Thu, 15 Oct 2020 11:37:47 +1100
Subject: [PATCH] dev/core#2125 Ensure that the id that is used in the field is
 the group id not the id of array key as that has changed from being a keyed
 array to a 2D array

---
 CRM/Contact/Form/Edit/TagsAndGroups.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/CRM/Contact/Form/Edit/TagsAndGroups.php b/CRM/Contact/Form/Edit/TagsAndGroups.php
index de2084c0a2a..73e9420dff9 100644
--- a/CRM/Contact/Form/Edit/TagsAndGroups.php
+++ b/CRM/Contact/Form/Edit/TagsAndGroups.php
@@ -93,7 +93,8 @@ class CRM_Contact_Form_Edit_TagsAndGroups {
         $attributes['skiplabel'] = TRUE;
         $elements = [];
         $groupsOptions = [];
-        foreach ($groups as $id => $group) {
+        foreach ($groups as $group) {
+          $id = $group['id'];
           // make sure that this group has public visibility
           if ($visibility &&
             $group['visibility'] == 'User and User Admin Only'
-- 
GitLab