[REF] Do not treat site having a default location type as optional
authorEileen McNaughton <emcnaughton@wikimedia.org>
Thu, 21 Apr 2022 23:37:31 +0000 (11:37 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 3 May 2022 02:14:16 +0000 (14:14 +1200)
I found plenty of places where the code expects a response from
this function - just a couple of places in really old code
(like this) where it is optional....

CRM/Contact/Import/Form/MapField.php

index 7e69bb72ae76f6e4fd6969c7a5f6ca84bdc765d5..b3dbf1ae71162d3932338d16e5b5505f500d017d 100644 (file)
@@ -138,12 +138,8 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField {
 
     $this->_location_types = ['Primary' => ts('Primary')] + CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
     $defaultLocationType = CRM_Core_BAO_LocationType::getDefault();
-
-    // Pass default location to js
-    if ($defaultLocationType) {
-      $this->assign('defaultLocationType', $defaultLocationType->id);
-      $this->assign('defaultLocationTypeLabel', $this->_location_types[$defaultLocationType->id]);
-    }
+    $this->assign('defaultLocationType', $defaultLocationType->id);
+    $this->assign('defaultLocationTypeLabel', $this->_location_types[$defaultLocationType->id]);
 
     /* Initialize all field usages to false */
     foreach ($mapperKeys as $key) {