$websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
$multipleFields = array('url');
- $nullIndex = $nullValueIndex = ' ';
//start of code to set the default values
foreach ($fields as $name => $field) {
continue;
}
+ // Create a unique, non-empty index for each field.
$index = $field['title'];
- //handle for the label not set for the field
- if (empty($field['title'])) {
- $index = $nullIndex;
- $nullIndex .= $nullIndex;
- }
+ if ($index === '') $index = ' ';
+ while (array_key_exists($index, $values))
+ $index .= ' ';
- //handle the case to avoid re-write where the profile field labels are the same
- if (array_key_exists($index, $values)) {
- $index .= $nullValueIndex;
- $nullValueIndex .= $nullValueIndex;
- }
$params[$index] = $values[$index] = '';
$customFieldName = NULL;
// hack for CRM-665
$profileFields = array();
$labels = array();
- //CRM-14338
- $nullValueIndex = ' ';
foreach ($fields as $name => $field) {
- 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);
- }
+ //CRM-14338
+ // Create a unique, non-empty index for each field.
+ $index = $field['title'];
+ if ($index === '') $index = ' ';
+ while (array_key_exists($index, $labels))
+ $index .= ' ';
+
+ $labels[$index] = preg_replace('/\s+|\W+/', '_', $name);
}
foreach ($values as $title => $value) {