*/
protected static function getMultiValueCidRefs() {
$fields = \Civi\Api4\CustomField::get(FALSE)
- ->addSelect('custom_group.table_name', 'column_name', 'serialize')
+ ->addSelect('custom_group_id.table_name', 'column_name', 'serialize')
->addWhere('data_type', '=', 'ContactReference')
->addWhere('serialize', 'IS NOT EMPTY')
->execute();
$map = [];
foreach ($fields as $field) {
- $map[$field['custom_group.table_name']][$field['column_name']] = $field['serialize'];
+ $map[$field['custom_group_id.table_name']][$field['column_name']] = $field['serialize'];
}
return $map;
}
// handle custom fields
$mainTree = CRM_Core_BAO_CustomGroup::getTree($main['contact_type'], NULL, $mainId, -1,
- CRM_Utils_Array::value('contact_sub_type', $main), NULL, TRUE, NULL, TRUE, $checkPermissions
+ CRM_Utils_Array::value('contact_sub_type', $main), NULL, TRUE, NULL, TRUE,
+ $checkPermissions ? CRM_Core_Permission::EDIT : FALSE
);
$otherTree = CRM_Core_BAO_CustomGroup::getTree($main['contact_type'], NULL, $otherId, -1,
- CRM_Utils_Array::value('contact_sub_type', $other), NULL, TRUE, NULL, TRUE, $checkPermissions
+ CRM_Utils_Array::value('contact_sub_type', $other), NULL, TRUE, NULL, TRUE,
+ $checkPermissions ? CRM_Core_Permission::EDIT : FALSE
);
foreach ($otherTree as $gid => $group) {