Skip to content
Snippets Groups Projects
Commit dd9d7b83 authored by Eileen McNaughton's avatar Eileen McNaughton
Browse files

fix failing profile api test by preventing double-adding of same alias

parent b259a4ab
No related branches found
No related tags found
No related merge requests found
...@@ -580,8 +580,10 @@ function _civicrm_api3_buildprofile_submitfields($profileID, $optionsBehaviour = ...@@ -580,8 +580,10 @@ function _civicrm_api3_buildprofile_submitfields($profileID, $optionsBehaviour =
if(isset($profileFields[$profileID][$entityfield])) { if(isset($profileFields[$profileID][$entityfield])) {
unset($profileFields[$profileID][$entityfield]); unset($profileFields[$profileID][$entityfield]);
} }
// we will make the mixed case version (e.g. of 'Primary') an alias if(!in_array($entityfield, $profileFields[$profileID][$fieldName]['api.aliases'])) {
$profileFields[$profileID][$fieldName]['api.aliases'][] = $entityfield; // we will make the mixed case version (e.g. of 'Primary') an alias
$profileFields[$profileID][$fieldName]['api.aliases'][] = $entityfield;
}
} }
/** /**
* putting this on hold -this would cause the api to set the default - but could have unexpected behaviour * putting this on hold -this would cause the api to set the default - but could have unexpected behaviour
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment