From 45a507437772632c4f1c7ea4a6b042aaec3f43f6 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton <emcnaughton@wikimedia.org> Date: Fri, 22 Apr 2022 11:37:31 +1200 Subject: [PATCH] [REF] Do not treat site having a default location type as optional 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 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/CRM/Contact/Import/Form/MapField.php b/CRM/Contact/Import/Form/MapField.php index 7e69bb72ae..b3dbf1ae71 100644 --- a/CRM/Contact/Import/Form/MapField.php +++ b/CRM/Contact/Import/Form/MapField.php @@ -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) { -- 2.25.1