Skip to content
Snippets Groups Projects
Commit 90a1e5ff authored by colemanw's avatar colemanw
Browse files

CustomGroup - Remove unnecessary workaround for contact types

Now that Api4 directly supports contact types as entities,
this workaround is not needed.
parent 9fc0a1b5
Branches
Tags
No related merge requests found
......@@ -1804,18 +1804,11 @@ class CRM_Core_BAO_CustomGroup extends CRM_Core_DAO_CustomGroup implements \Civi
if (!$grouping) {
return [];
}
$getFieldsValues = [];
// For contact types
if (in_array($extends, CRM_Contact_BAO_ContactType::basicTypes(TRUE), TRUE)) {
$getFieldsValues['contact_type'] = $extends;
$extends = 'Contact';
}
try {
$field = civicrm_api4($extends, 'getFields', [
'checkPermissions' => FALSE,
'loadOptions' => ['id', 'name', 'label'],
'where' => [['name', '=', $grouping]],
'values' => $getFieldsValues,
])->first();
if ($field['options']) {
return $field['options'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment