diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index ee0f3fa3b19d..46509d248949 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -1046,11 +1046,12 @@ public static function deleteContactImage($id) { if (!$id) { return FALSE; } - $query = " -UPDATE civicrm_contact -SET image_URL=NULL -WHERE id={$id}; "; - CRM_Core_DAO::executeQuery($query); + + $contact = new self(); + $contact->id = $id; + $contact->image_URL = 'null'; + $contact->save(); + return TRUE; }