}
$dao = new CRM_Core_DAO();
$qParams = array();
- $svq = $dao->singleValueQuery("SELECT id FROM civicrm_contact WHERE id = $value",
+ $svq = $dao->singleValueQuery("SELECT is_deleted FROM civicrm_contact WHERE id = $value",
$qParams
);
- if (!$svq) {
+ if (!isset($svq)) {
return civicrm_api3_create_error("Invalid Contact ID: There is no contact record with contact_id = $value.");
+ } else if ($svq == 1) {
+ return civicrm_api3_create_error("Invalid Contact ID: contact_id $value is a soft-deleted contact.");
}
$values['contact_id'] = $values['contribution_contact_id'];
}
/**
- * Function to check duplicate contacts based on de-deupe parameters
+ * check duplicate contacts based on de-deupe parameters
*/
function _civicrm_api3_deprecated_check_contact_dedupe($params) {
static $cIndieFields = NULL;
/**
* @deprecated - this is part of the import parser not the API & needs to be moved on out
*
- * @param $params
+ * @param array $params
* @param $onDuplicate
*
- * @internal param $ <type> $params
- * @internal param $ <type> $onDuplicate
- *
* @return array|bool <type>
*/
function _civicrm_api3_deprecated_create_participant_formatted($params, $onDuplicate) {
if (!empty($params['event_id'])) {
$isTemplate = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $params['event_id'], 'is_template');
if (!empty($isTemplate)) {
- return civicrm_api3_create_error(ts('Event templates are not meant to be registered'));
+ return civicrm_api3_create_error(ts('Event templates are not meant to be registered.'));
}
}
}
/**
- * @param $params
+ * @param array $params
* @param bool $dupeCheck
* @param bool $dupeErrorArray
* @param bool $requiredCheck
if ($csType = CRM_Utils_Array::value('contact_sub_type', $params)) {
if (!(CRM_Contact_BAO_ContactType::isExtendsContactType($csType, $params['contact_type']))) {
- return civicrm_api3_create_error("Invalid or Mismatched Contact SubType: " . implode(', ', (array)$csType));
+ return civicrm_api3_create_error("Invalid or Mismatched Contact Subtype: " . implode(', ', (array)$csType));
}
}
* @param $result
* @param $activityTypeID
*
- * @internal param $ <type> $result
- * @internal param $ <type> $activityTypeID
- *
* @return array <type> $params
*/
function _civicrm_api3_deprecated_activity_buildmailparams($result, $activityTypeID) {