From cffc5e59b78a412b47889ed3ed9460c2bbdd7063 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 10 Apr 2015 16:20:34 -0400 Subject: [PATCH] CRM-16271 - Fix formatting of custom fields on name badges --- CRM/Badge/BAO/Badge.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CRM/Badge/BAO/Badge.php b/CRM/Badge/BAO/Badge.php index bfdc33568a..90953f9567 100644 --- a/CRM/Badge/BAO/Badge.php +++ b/CRM/Badge/BAO/Badge.php @@ -486,7 +486,12 @@ class CRM_Badge_BAO_Badge { $query->convertToPseudoNames($dao); $rows[$dao->participant_id] = array(); foreach ($returnProperties as $key => $dontCare) { - $rows[$dao->participant_id][$key] = isset($dao->$key) ? $dao->$key : NULL; + $value = isset($dao->$key) ? $dao->$key : NULL; + // Format custom fields + if (strstr($key, 'custom_') && isset($value)) { + $value = CRM_Core_BAO_CustomField::getDisplayValue($value, substr($key, 7), $query->_options, $dao->contact_id); + } + $rows[$dao->participant_id][$key] = $value; } } -- 2.25.1