Skip to content

Commit

Permalink
Merge pull request #11386 from agileware/CIVICRM-754
Browse files Browse the repository at this point in the history
CRM-21535: Custom file upload field not showing up when Viewing Activity from Case Report.
  • Loading branch information
colemanw authored Dec 11, 2017
2 parents 9a61e37 + cf34632 commit 76b75c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 1 addition & 5 deletions CRM/Case/XMLProcessor/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ public function getCustomData($clientID, $activityDAO, &$activityTypeInfo) {
$value = $dao->$columnName;
}
else {
$value = CRM_Core_BAO_CustomField::displayValue($dao->$columnName, $typeValue['fieldID']);
$value = CRM_Core_BAO_CustomField::displayValue($dao->$columnName, $typeValue['fieldID'], $activityDAO->id);
}

if ($value) {
Expand All @@ -572,10 +572,6 @@ public function getCustomData($clientID, $activityDAO, &$activityTypeInfo) {
) {
$value = $this->redact($value);
}
elseif (CRM_Utils_Array::value('type', $typeValue) == 'File') {
$tableName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_EntityFile', $typeValue, 'entity_table');
$value = CRM_Core_BAO_File::attachmentInfo($tableName, $activityDAO->id);
}
elseif (CRM_Utils_Array::value('type', $typeValue) == 'Link') {
$value = CRM_Utils_System::formatWikiURL($value);
}
Expand Down
6 changes: 3 additions & 3 deletions CRM/Core/BAO/CustomField.php
Original file line number Diff line number Diff line change
Expand Up @@ -1141,12 +1141,12 @@ public static function deleteField($field) {
/**
* @param string|int|array|null $value
* @param CRM_Core_BAO_CustomField|int|array|string $field
* @param $contactId
* @param int $entityId
*
* @return string
* @throws \Exception
*/
public static function displayValue($value, $field, $contactId = NULL) {
public static function displayValue($value, $field, $entityId = NULL) {
$field = is_array($field) ? $field['id'] : $field;
$fieldId = is_object($field) ? $field->id : (int) str_replace('custom_', '', $field);

Expand All @@ -1160,7 +1160,7 @@ public static function displayValue($value, $field, $contactId = NULL) {

$fieldInfo = array('options' => $field->getOptions()) + (array) $field;

return self::formatDisplayValue($value, $fieldInfo, $contactId);
return self::formatDisplayValue($value, $fieldInfo, $entityId);
}

/**
Expand Down

0 comments on commit 76b75c5

Please sign in to comment.