Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-21535: Custom file upload field not showing up when Viewing Activity from Case Report. #11386

Merged
merged 2 commits into from
Dec 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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