-
- if ($isContactActivityProfile && CRM_Utils_Array::value('field_type', $field) == 'Activity') {
- $activityParams[$fieldName] = $value;
+ $contactEntities = array('contact', 'individual', 'organization', 'household');
+ $locationEntities = array('email', 'address', 'phone', 'website', 'im');
+
+ $entity = strtolower(CRM_Utils_Array::value('entity', $field));
+ if($entity && !in_array($entity, array_merge($contactEntities, $locationEntities))) {
+ $contactParams['api.' . $entity . '.create'][$fieldName] = $value;
+ if(isset($params[$entity . '_id'])) {
+ //todo possibly declare $entity_id in getfields ?
+ $contactParams['api.' . $entity . '.create']['id'] = $params[$entity . '_id'];
+ }