From: Eileen McNaughton Date: Fri, 20 May 2022 22:27:42 +0000 (+1200) Subject: Remove extraneous deprecated check X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=43beb5bc006cb2f95faa467f72ccb858b1bab416;p=civicrm-core.git Remove extraneous deprecated check --- diff --git a/CRM/Contact/Import/Parser/Contact.php b/CRM/Contact/Import/Parser/Contact.php index 1d66be5885..f7fe4e1b45 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -1530,7 +1530,6 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { if ($error) { return $error; } - $this->deprecated_validate_formatted_contact($formatted); } catch (CRM_Core_Exception $e) { return ['error_message' => $e->getMessage(), 'is_error' => 1, 'code' => $e->getCode()]; @@ -1930,37 +1929,6 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { return $this->processMessage($values, CRM_Import_Parser::VALID); } - /** - * Validate a formatted contact parameter list. - * - * @param array $params - * Structured parameter list (as in crm_format_params). - * - * @throw CRM_Core_Error - */ - public function deprecated_validate_formatted_contact(&$params): void { - // Validate custom data fields - if (array_key_exists('custom', $params) && is_array($params['custom'])) { - foreach ($params['custom'] as $key => $custom) { - if (is_array($custom)) { - foreach ($custom as $fieldId => $value) { - $valid = CRM_Core_BAO_CustomValue::typecheck(CRM_Utils_Array::value('type', $value), - CRM_Utils_Array::value('value', $value) - ); - if (!$valid && $value['is_required']) { - throw new CRM_Core_Exception('Invalid value for custom field \'' . - $custom['name'] . '\'' - ); - } - if (CRM_Utils_Array::value('type', $custom) == 'Date') { - $params['custom'][$key][$fieldId]['value'] = str_replace('-', '', $params['custom'][$key][$fieldId]['value']); - } - } - } - } - } - } - /** * @param array $params * @param bool $dupeCheck