X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FBAO%2FUFGroup.php;h=cd7a474c1250eb3b34c83bcf9fc657cb0ca2b53f;hb=3838662faff56daff7b4fbbd25c60a4b7242a484;hp=4ad97b78ab24433fc9cc83dd61956aa41eb52467;hpb=0671028905130f2a767a73b42466bb264f6ff23d;p=civicrm-core.git diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index 4ad97b78ab..cd7a474c12 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -958,7 +958,6 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { $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) { @@ -972,18 +971,12 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { 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 @@ -3456,7 +3449,7 @@ SELECT group_id } /** - * Funtion to determine of we show overlay profile or not + * Function to determine of we show overlay profile or not * * @return boolean true if profile should be shown else false * @static