}
//handle the case to avoid re-write where the profile field labels are the same
- if (CRM_Utils_Array::value($index, $values)) {
+ if (array_key_exists($index, $values)) {
$index .= $nullValueIndex;
$nullValueIndex .= $nullValueIndex;
}
if (isset($details->$name) || $name == 'group' || $name == 'tag') {
// to handle gender / suffix / prefix
if (in_array(substr($name, 0, -3), array('gender', 'prefix', 'suffix'))) {
- $values[$index] = CRM_Core_PseudoConstant::getLabel('CRM_Contact_DAO_Contact', $name, $details->$name);
$params[$index] = $details->$name;
+ $values[$index] = $details->$name;
}
elseif (in_array($name, CRM_Contact_BAO_Contact::$_greetingTypes)) {
$dname = $name . '_display';
$profileFields = array();
$labels = array();
+ //CRM-14338
+ $nullValueIndex = ' ';
foreach ($fields as $name => $field) {
- $labels[$field['title']] = preg_replace('/\s+|\W+/', '_', $name);
+ if ( isset($labels[$field['title']]) ) {
+ $labels[$field['title'].$nullValueIndex] = preg_replace('/\s+|\W+/', '_', $name);
+ $nullValueIndex .= $nullValueIndex;
+ }
+ else {
+ $labels[$field['title']] = preg_replace('/\s+|\W+/', '_', $name);
+ }
}
foreach ($values as $title => $value) {