dev/core#1861 fix failure to unset location_type_id when saving uffield
authoreileen <emcnaughton@wikimedia.org>
Mon, 13 Jul 2020 07:06:27 +0000 (19:06 +1200)
committereileen <emcnaughton@wikimedia.org>
Mon, 13 Jul 2020 08:14:04 +0000 (20:14 +1200)
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

CRM/UF/Form/Field.php

index 4476ef73038f0f61e76aeddb14f3813fd0cce3f6..d99adfe45130ee8d21556497d69ad21459423db3 100644 (file)
@@ -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];