Skip to content

Commit

Permalink
Merge pull request #1040 from compucorp/comcl-754-fix-case-custom-fields
Browse files Browse the repository at this point in the history
COMCL-754: Fix Custom Field Values For Cases
  • Loading branch information
shahrukh-compuco authored Aug 29, 2024
2 parents 2efcfef + d1cc8fe commit 6480674
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions CRM/Civicase/APIHelpers/CustomValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static function getTreeParams(array $params) {
'custom_value' => [],
];
foreach (array_keys($options['return']) as $r) {
list($type, $field) = explode('.', $r);
[$type, $field] = explode('.', $r);
if (isset($toReturn[$type])) {
$toReturn[$type][] = $field;
}
Expand Down Expand Up @@ -103,7 +103,6 @@ public static function getTreeParams(array $params) {
break;

case 'Participant':
// Todo.
}
$treeParams = [
'entityType' => $params['entity_type'],
Expand Down Expand Up @@ -163,7 +162,7 @@ public static function formatTreeResults(array $tree, array &$result, array $toR
if (!empty($fieldInfo['customValue'])) {
$field['value'] = CRM_Utils_Array::first($fieldInfo['customValue']);
if (!$toReturn['custom_value'] || in_array('display', $toReturn['custom_value'])) {
$field['value']['display'] = CRM_Core_BAO_CustomField::displayValue($field['value']['data'], $fieldInfo);
$field['value']['display'] = CRM_Core_BAO_CustomField::displayValue($field['value']['data'], $fieldInfo['id']);
}
foreach (array_keys($field['value']) as $key) {
if ($toReturn['custom_value'] && !in_array($key, $toReturn['custom_value'])) {
Expand Down

0 comments on commit 6480674

Please sign in to comment.