From 0aaa64900148adca67e64dc77fd0556ebcf12d5a Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 2 Jun 2022 18:42:57 +1200 Subject: [PATCH] Remove function that no longer does anything This is now only checking booleans in a way that duplicates getTransformedValue --- CRM/Contact/Import/Parser/Contact.php | 39 --------------------------- 1 file changed, 39 deletions(-) diff --git a/CRM/Contact/Import/Parser/Contact.php b/CRM/Contact/Import/Parser/Contact.php index b71bed850e..5fbd942808 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -708,44 +708,6 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { } } - /** - * Check if an error in Core( non-custom fields ) field - * - * @param array $params - * @param string $errorMessage - * A string containing all the error-fields. - */ - public function isErrorInCoreData($params, &$errorMessage) { - $errors = []; - - foreach ($params as $key => $value) { - if ($value) { - - switch ($key) { - case 'do_not_email': - case 'do_not_phone': - case 'do_not_mail': - case 'do_not_sms': - case 'do_not_trade': - if (CRM_Utils_Rule::boolean($value) == FALSE) { - $key = ucwords(str_replace("_", " ", $key)); - $errors[] = $key; - } - break; - - default: - if (is_array($params[$key]) && isset($params[$key]["contact_type"])) { - //check for any relationship data ,FIX ME - self::isErrorInCoreData($params[$key], $errorMessage); - } - } - } - } - if ($errors) { - $errorMessage .= ($errorMessage ? '; ' : '') . implode('; ', $errors); - } - } - /** * Ckeck a value present or not in a array. * @@ -834,7 +796,6 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { $errorMessage = implode(', ', $errors); //checking error in core data - $this->isErrorInCoreData($params, $errorMessage); if ($errorMessage) { $tempMsg = "Invalid value for field(s) : $errorMessage"; throw new CRM_Core_Exception($tempMsg); -- 2.25.1