Warning: Use of undefined constant id - assumed 'id' (this will throw an Error in a future version of PHP
Overview
Editing a contact puts a warning in the watchdog log:
Warning: Use of undefined constant id - assumed 'id' (this will throw an Error in a future version of PHP) in CRM_Contact_Form_Edit_TagsAndGroups::buildQuickForm() (line 105 of /mysite/sites/all/modules/civicrm/CRM/Contact/Form/Edit/TagsAndGroups.php).
Reproduction steps
Edit the email address for a contact.
Current behaviour
Editing a contact puts a warning in the watchdog log:
Warning: Use of undefined constant id - assumed 'id' (this will throw an Error in a future version of PHP) in CRM_Contact_Form_Edit_TagsAndGroups::buildQuickForm() (line 105 of /mysite/sites/all/modules/civicrm/CRM/Contact/Form/Edit/TagsAndGroups.php).
Expected behaviour
No warning.
Environment information
- CiviCRM: 5.29.1
Comments
Line 105 is currently
$groupsOptions[$group[id]] = $group;
It should be
$groupsOptions[$group['id']] = $group;