Skip to content
Snippets Groups Projects
Unverified Commit a7df6126 authored by colemanw's avatar colemanw Committed by GitHub
Browse files

Merge pull request #14341 from eileenmcnaughton/deprecated2

Remove never-called function _civicrm_api3_deprecated_contact_check_custom_params
parents 059b4b62 b61efec4
Branches 5.65
Tags 5.65.2
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment