From 0bab639efa466fef2a16512890a61181661a5673 Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 17 Mar 2020 15:44:01 +1300 Subject: [PATCH] Deprecate passing in silly data Later we can move to requiring an integer --- CRM/Contact/BAO/Contact.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 82eb740b62..dfa8325982 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -917,10 +917,14 @@ WHERE civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer'); * * @return bool * Was contact deleted? + * + * @throws \CRM_Core_Exception + * @throws \CiviCRM_API3_Exception */ public static function deleteContact($id, $restore = FALSE, $skipUndelete = FALSE, $checkPermissions = TRUE) { - if (!$id) { + if (!$id || !is_numeric($id)) { + CRM_Core_Error::deprecatedFunctionWarning('calling delete contact without a valid contact ID is deprecated.'); return FALSE; } // If trash is disabled in system settings then we always skip -- 2.25.1