From: eileen Date: Mon, 13 Jul 2020 07:06:27 +0000 (+1200) Subject: dev/core#1861 fix failure to unset location_type_id when saving uffield X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b0e240d9cd1f884e6e67381b50caefb5ea814856;p=civicrm-core.git dev/core#1861 fix failure to unset location_type_id when saving uffield https://lab.civicrm.org/dev/core/-/issues/1861 If this is a regression it probably from 2017 https://github.com/civicrm/civicrm-core/commit/2e74ff5574027b2ce84177b82884ebd7c9b87fd1#diff-1911d0c1a896701ba9aa044181f5972bR556 --- diff --git a/CRM/UF/Form/Field.php b/CRM/UF/Form/Field.php index 4476ef7303..d99adfe451 100644 --- a/CRM/UF/Form/Field.php +++ b/CRM/UF/Form/Field.php @@ -532,7 +532,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form { } elseif ($params['field_name'][2] == 0) { // 0 is Primary location type - $apiFormattedParams['location_type_id'] = NULL; + $apiFormattedParams['location_type_id'] = ''; } if (!empty($params['field_name'][3])) { $apiFormattedParams['phone_type_id'] = $params['field_name'][3];