$session = &CRM_Core_Session::singleton();
$params[$fieldname] = $session->get('userID');
}
- if (CRM_Utils_Array::value('pseudoconstant', $fieldInfo) ) {
+ if (!empty($fieldInfo['options'])) {
$constant = CRM_Utils_Array::value('options', $fieldInfo);
if (is_numeric($params[$fieldname]) && !CRM_Utils_Array::value('FKClassName',$fieldInfo) && !array_key_exists($params[$fieldname], $fieldInfo['options'])) {
throw new API_Exception("$fieldname is not valid", 2001, array('error_field' => $fieldname,"type"=>"integer"));
*/
private function _contactCreate($params) {
$params['version'] = API_LATEST_VERSION;
- $result = civicrm_api('Contact', 'create', $params);
+ $params['debug'] = 1;
+ $result = civicrm_api('contact', 'create', $params);
if (CRM_Utils_Array::value('is_error', $result) ||
!CRM_Utils_Array::value('id', $result)
) {
- throw new Exception('Could not create test contact, with message: ' . CRM_Utils_Array::value('error_message', $result));
+ throw new Exception('Could not create test contact, with message: ' . CRM_Utils_Array::value('error_message', $result) . "\nBacktrace:" . CRM_Utils_Array::value('trace', $result));
}
return $result['id'];
}
function contactDelete($contactID) {
- $params['id'] = $contactID;
- $params['version'] = API_LATEST_VERSION;
- $params['skip_undelete'] = 1;
+ $params = array(
+ 'id' => $contactID,
+ 'version' => API_LATEST_VERSION,
+ 'skip_undelete' => 1,
+ 'debug' => 1,
+ );
$domain = new CRM_Core_BAO_Domain;
$domain->contact_id = $contactID;
if ($domain->find(TRUE)) {
//since this is mainly for cleanup lets put a safeguard here
return;
}
- $result = civicrm_api('Contact', 'delete', $params);
+ $result = civicrm_api('contact', 'delete', $params);
if (CRM_Utils_Array::value('is_error', $result)) {
- throw new Exception('Could not delete contact, with message: ' . CRM_Utils_Array::value('error_message', $result));
+ throw new Exception('Could not delete contact, with message: ' . CRM_Utils_Array::value('error_message', $result) . "\nBacktrace:" . CRM_Utils_Array::value('trace', $result));
}
return;
}