$address->save();
if ($address->id) {
- $customFields = CRM_Core_BAO_CustomField::getFields('Address', FALSE, TRUE, NULL, NULL, FALSE, FALSE, $checkPermissions);
-
- if (!empty($customFields)) {
- $addressCustom = CRM_Core_BAO_CustomField::postProcess($params,
- $address->id,
- 'Address',
- FALSE,
- $checkPermissions
- );
+ if (isset($params['custom'])) {
+ $addressCustom = $params['custom'];
+ }
+ else {
+ $customFields = CRM_Core_BAO_CustomField::getFields('Address', FALSE, TRUE, NULL, NULL, FALSE, FALSE, $checkPermissions);
+
+ if (!empty($customFields)) {
+ $addressCustom = CRM_Core_BAO_CustomField::postProcess($params,
+ $address->id,
+ 'Address',
+ FALSE,
+ $checkPermissions
+ );
+ }
}
if (!empty($addressCustom)) {
CRM_Core_BAO_CustomValueTable::store($addressCustom, 'civicrm_address', $address->id);