Merge pull request #17912 from eileenmcnaughton/flex2
[civicrm-core.git] / CRM / UF / Form / Field.php
index 4476ef73038f0f61e76aeddb14f3813fd0cce3f6..4bfcb214af81150eddebdc9b685c6a948d8218f7 100644 (file)
@@ -530,9 +530,9 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
         $apiFormattedParams['location_type_id'] = $params['field_name'][2];
       }
     }
-    elseif ($params['field_name'][2] == 0) {
+    elseif (isset($params['field_name'][2]) && $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];