diff --git a/CRM/Utils/DeprecatedUtils.php b/CRM/Utils/DeprecatedUtils.php index 9d2d7ca4e088bdde203ebdef084341a564524237..5d8e0e1bec20e1108a278f0c5a8a2c94ed9556c0 100644 --- a/CRM/Utils/DeprecatedUtils.php +++ b/CRM/Utils/DeprecatedUtils.php @@ -1143,47 +1143,6 @@ function _civicrm_api3_deprecated_participant_check_params($params, $checkDuplic return TRUE; } -/** - * Ensure that we have the right input parameters for custom data - * - * @param array $params - * Associative array of property name/value. - * pairs to insert in new contact. - * @param string $csType - * Contact subtype if exists/passed. - * - * @return null - * on success, error message otherwise - */ -function _civicrm_api3_deprecated_contact_check_custom_params($params, $csType = NULL) { - empty($csType) ? $onlyParent = TRUE : $onlyParent = FALSE; - - require_once 'CRM/Core/BAO/CustomField.php'; - $customFields = CRM_Core_BAO_CustomField::getFields($params['contact_type'], - FALSE, - FALSE, - $csType, - NULL, - $onlyParent, - FALSE, - FALSE - ); - - foreach ($params as $key => $value) { - if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($key)) { - // check if it's a valid custom field id - if (!array_key_exists($customFieldID, $customFields)) { - - $errorMsg = "Invalid Custom Field Contact Type: {$params['contact_type']}"; - if (!empty($csType)) { - $errorMsg .= " or Mismatched SubType: " . implode(', ', (array) $csType); - } - return civicrm_api3_create_error($errorMsg); - } - } - } -} - /** * @param array $params * @param bool $dupeCheck