Commit 43fee107 authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub

Merge pull request #14535 from colemanw/addressCustom

Address BAO - Handle standard 'custom' param as well as individual fields
parents a83adcb2 2c59f0ca
......@@ -162,15 +162,20 @@ class CRM_Core_BAO_Address extends CRM_Core_DAO_Address {
$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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment