From b61efec4016aad0d7d50989939f08ae91a50c533 Mon Sep 17 00:00:00 2001 From: eileen <emcnaughton@wikimedia.org> Date: Sun, 26 May 2019 14:56:00 +1200 Subject: [PATCH] Remove never-called function _civicrm_api3_deprecated_contact_check_custom_params --- CRM/Utils/DeprecatedUtils.php | 41 ----------------------------------- 1 file changed, 41 deletions(-) diff --git a/CRM/Utils/DeprecatedUtils.php b/CRM/Utils/DeprecatedUtils.php index 9d2d7ca4e08..5d8e0e1bec2 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 -- GitLab