From 82ae1fdd59e224bb6e1876b79de595d7fb023361 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 16 Aug 2022 10:40:48 +1200 Subject: [PATCH] Rename function --- CRM/Contact/Import/Form/MapField.php | 2 +- CRM/Import/Parser.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/Import/Form/MapField.php b/CRM/Contact/Import/Form/MapField.php index 504f0f1cef..8f7f958cf7 100644 --- a/CRM/Contact/Import/Form/MapField.php +++ b/CRM/Contact/Import/Form/MapField.php @@ -491,7 +491,7 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField { */ private function isLocationTypeRequired($name): bool { if (!isset(Civi::$statics[__CLASS__]['location_fields'])) { - Civi::$statics[__CLASS__]['location_fields'] = (new CRM_Contact_Import_Parser_Contact())->setUserJobID($this->getUserJobID())->getSelectTypes(); + Civi::$statics[__CLASS__]['location_fields'] = (new CRM_Contact_Import_Parser_Contact())->setUserJobID($this->getUserJobID())->getFieldsWhichSupportLocationTypes(); } return (bool) (Civi::$statics[__CLASS__]['location_fields'][$name] ?? FALSE); } diff --git a/CRM/Import/Parser.php b/CRM/Import/Parser.php index e878def6d9..5574ce39f9 100644 --- a/CRM/Import/Parser.php +++ b/CRM/Import/Parser.php @@ -493,9 +493,11 @@ abstract class CRM_Import_Parser implements UserJobInterface { } /** + * Get an array of available fields that support location types (e.g phone, street_address etc). + * * @return array */ - public function getSelectTypes() { + public function getFieldsWhichSupportLocationTypes(): array { $values = []; // This is only called from the MapField form in isolation now, foreach ($this->getFieldsMetadata() as $name => $field) { -- 2.25.1