From 13bfe4d19ce65faa75d11d0ba7be5cd71da28f3c Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 17 Aug 2022 14:22:29 +1200 Subject: [PATCH] Remove now-unused addField from Custom import --- CRM/Custom/Import/Field.php | 16 ------------ CRM/Custom/Import/Parser/Api.php | 44 +------------------------------- 2 files changed, 1 insertion(+), 59 deletions(-) delete mode 100644 CRM/Custom/Import/Field.php diff --git a/CRM/Custom/Import/Field.php b/CRM/Custom/Import/Field.php deleted file mode 100644 index 6b005d3e64..0000000000 --- a/CRM/Custom/Import/Field.php +++ /dev/null @@ -1,16 +0,0 @@ -userJob); - $this->setFieldMetadata(); - $fields = $this->importableFieldsMetadata; - $hasLocationType = FALSE; - - foreach ($fields as $name => $field) { - $field['type'] = CRM_Utils_Array::value('type', $field, CRM_Utils_Type::T_INT); - $field['dataPattern'] = CRM_Utils_Array::value('dataPattern', $field, '//'); - $field['headerPattern'] = CRM_Utils_Array::value('headerPattern', $field, '//'); - $this->addField($name, $field['title'], $field['type'], $field['headerPattern'], $field['dataPattern'], $hasLocationType); - } - } - /** * Main import function. * @@ -167,7 +147,7 @@ class CRM_Custom_Import_Parser_Api extends CRM_Import_Parser { if ((strtolower($v2['label']) == strtolower(trim($v1))) || (strtolower($v2['value']) == strtolower(trim($v1))) ) { - if ($htmlType == 'CheckBox') { + if ($htmlType === 'CheckBox') { $params[$key][$v2['value']] = $formatted[$key][$v2['value']] = 1; } else { @@ -233,26 +213,4 @@ class CRM_Custom_Import_Parser_Api extends CRM_Import_Parser { return $importableFields; } - /** - * @deprecated stores metadata in the old format that - * a few functions in the parent class still use. - * - * @param string $name - * @param $title - * @param int $type - * @param string $headerPattern - * @param string $dataPattern - * @param bool $hasLocationType - */ - private function addField( - $name, $title, $type = CRM_Utils_Type::T_INT, - $headerPattern = '//', $dataPattern = '//', - $hasLocationType = FALSE - ) { - $this->_fields[$name] = new CRM_Custom_Import_Field($name, $title, $type, $headerPattern, $dataPattern, $hasLocationType); - if (empty($name)) { - $this->_fields['doNotImport'] = new CRM_Custom_Import_Field($name, $title, $type, $headerPattern, $dataPattern, $hasLocationType); - } - } - } -- 2.25.1