From f3ceb1120bd50a5ac830ba405b3c6f72144480cb Mon Sep 17 00:00:00 2001 From: Alok Patel Date: Thu, 7 Dec 2017 18:15:16 +0530 Subject: [PATCH 1/2] CIVICRM-754: Displaying Activity custom fields(Files) when opening from Case Report. --- CRM/Case/XMLProcessor/Report.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/CRM/Case/XMLProcessor/Report.php b/CRM/Case/XMLProcessor/Report.php index 8ece8d55998d..1cc5732e0780 100644 --- a/CRM/Case/XMLProcessor/Report.php +++ b/CRM/Case/XMLProcessor/Report.php @@ -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) { @@ -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); } From cf346323bbb86e16057f8f69e2d4293df2a276a4 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 7 Dec 2017 12:33:50 -0500 Subject: [PATCH 2/2] Rename variable for consistency --- CRM/Core/BAO/CustomField.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CRM/Core/BAO/CustomField.php b/CRM/Core/BAO/CustomField.php index 4b1b11cfae77..26887449a93f 100644 --- a/CRM/Core/BAO/CustomField.php +++ b/CRM/Core/BAO/CustomField.php @@ -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); @@ -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); } /**