diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index f068d0a0337c..130dbfc63b3d 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -122,7 +122,7 @@ public static function add(&$params) { ) { // we'll need to fix tests to handle this // CRM-7925 - CRM_Core_Error::fatal(ts('The Contact Sub Type does not match the Contact type for this record')); + throw new CRM_Core_Exception(ts('The Contact Sub Type does not match the Contact type for this record')); } $params['contact_sub_type'] = CRM_Utils_Array::implodePadded($params['contact_sub_type']); } @@ -295,12 +295,6 @@ public static function &create(&$params, $fixAddress = TRUE, $invokeHooks = TRUE $transaction = new CRM_Core_Transaction(); $contact = self::add($params); - if (!$contact) { - // Not dying here is stupid, since we get into weird situation and into a bug that - // is impossible to figure out for the user or for us - // CRM-7925 - CRM_Core_Error::fatal(); - } $params['contact_id'] = $contact->id;