Commit 7396f7c6 authored by mattwire's avatar mattwire
Browse files

Use API4 for 5.24 support

parent bc0d4036
...@@ -21,6 +21,7 @@ class CRM_Groupadmin_Form_Edit extends CRM_Core_Form { ...@@ -21,6 +21,7 @@ class CRM_Groupadmin_Form_Edit extends CRM_Core_Form {
$this->assign('groupTitle', civicrm_api3('Group', 'getvalue', ['id' => $this->groupID, 'return' => 'title'])); $this->assign('groupTitle', civicrm_api3('Group', 'getvalue', ['id' => $this->groupID, 'return' => 'title']));
/* Join not supported until 5.27 - https://github.com/civicrm/civicrm-core/commit/16f5a13d62017fa30190a477b9f580b4eabd23a2
$groupAdminContacts = \Civi\Api4\GroupAdminContact::get() $groupAdminContacts = \Civi\Api4\GroupAdminContact::get()
->addSelect('contact_id', 'contact.display_name') ->addSelect('contact_id', 'contact.display_name')
->setJoin([ ->setJoin([
...@@ -29,6 +30,12 @@ class CRM_Groupadmin_Form_Edit extends CRM_Core_Form { ...@@ -29,6 +30,12 @@ class CRM_Groupadmin_Form_Edit extends CRM_Core_Form {
->addWhere('group_id', '=', $this->groupID) ->addWhere('group_id', '=', $this->groupID)
->setCheckPermissions(FALSE) ->setCheckPermissions(FALSE)
->execute(); ->execute();
*/
$groupAdminContacts = civicrm_api3('GroupAdminContact', 'get', [
'return' => ['contact_id', 'contact.display_name'],
'group_id' => $this->groupID,
])['values'];
foreach ($groupAdminContacts as $groupAdminContact) { foreach ($groupAdminContacts as $groupAdminContact) {
$adminContacts[$groupAdminContact['contact_id']] = $groupAdminContact['contact.display_name']; $adminContacts[$groupAdminContact['contact_id']] = $groupAdminContact['contact.display_name'];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment