Commit 92e4c2a5 authored by totten's avatar totten

INFRA-132 - s/(else|try){/(else|try) {/

parent 86bfa4f6
...@@ -149,7 +149,7 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form { ...@@ -149,7 +149,7 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form {
$props['html_type'] == 'select' ? CRM_Utils_Array::value('html_attributes', $props) : NULL $props['html_type'] == 'select' ? CRM_Utils_Array::value('html_attributes', $props) : NULL
); );
} }
else{ else {
$this->$add($setting, ts($props['title'])); $this->$add($setting, ts($props['title']));
} }
$this->assign("{$setting}_description", ts($props['description'])); $this->assign("{$setting}_description", ts($props['description']));
......
...@@ -88,7 +88,7 @@ class CRM_Contact_BAO_Contact_Utils { ...@@ -88,7 +88,7 @@ class CRM_Contact_BAO_Contact_Utils {
if ($addProfileOverlay) { if ($addProfileOverlay) {
$imageInfo[$contactType]['image'] = "<div class=\"icon crm-icon {$type}-icon\"></div>"; $imageInfo[$contactType]['image'] = "<div class=\"icon crm-icon {$type}-icon\"></div>";
} }
else{ else {
$imageInfo[$contactType]['image'] = "<div class=\"icon crm-icon {$type}-icon\" title=\"{$contactType}\"></div>"; $imageInfo[$contactType]['image'] = "<div class=\"icon crm-icon {$type}-icon\" title=\"{$contactType}\"></div>";
} }
$imageInfo[$contactType]['url'] = NULL; $imageInfo[$contactType]['url'] = NULL;
......
...@@ -93,7 +93,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { ...@@ -93,7 +93,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship {
$hook = 'create'; $hook = 'create';
$action = CRM_Core_Action::ADD; $action = CRM_Core_Action::ADD;
} }
else{ else {
$hook = 'edit'; $hook = 'edit';
$action = CRM_Core_Action::UPDATE; $action = CRM_Core_Action::UPDATE;
} }
...@@ -240,7 +240,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { ...@@ -240,7 +240,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship {
$relationship->$defaultField = 'NULL'; $relationship->$defaultField = 'NULL';
} }
} }
else{ else {
$relationship->$defaultField = $params[$defaultField]; $relationship->$defaultField = $params[$defaultField];
} }
} }
...@@ -1738,7 +1738,7 @@ AND cc.sort_name LIKE '%$name%'"; ...@@ -1738,7 +1738,7 @@ AND cc.sort_name LIKE '%$name%'";
elseif(!empty($clauses)) { elseif(!empty($clauses)) {
return explode(' OR ', $clauses); return explode(' OR ', $clauses);
} }
else{ else {
// effectively setting it to return no results // effectively setting it to return no results
$params['relationship_type_id'] = 0; $params['relationship_type_id'] = 0;
} }
......
...@@ -152,7 +152,7 @@ class CRM_Contribute_BAO_Contribution_Utils { ...@@ -152,7 +152,7 @@ class CRM_Contribute_BAO_Contribution_Utils {
// this does not return // this does not return
$result = $payment->doTransferCheckout($form->_params, 'contribute'); $result = $payment->doTransferCheckout($form->_params, 'contribute');
} }
else{ else {
CRM_Core_Error::fatal($paymentObjError); CRM_Core_Error::fatal($paymentObjError);
} }
} }
......
...@@ -605,7 +605,7 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task { ...@@ -605,7 +605,7 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task {
'name' 'name'
); );
} }
else{ else {
$activityTypeID = CRM_Core_OptionGroup::getValue('activity_type', $activityTypeID = CRM_Core_OptionGroup::getValue('activity_type',
'Emailed Invoice', 'Emailed Invoice',
'name' 'name'
......
...@@ -1502,7 +1502,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { ...@@ -1502,7 +1502,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
CRM_Utils_Array::value("{$fieldName}_time", $params), TRUE) CRM_Utils_Array::value("{$fieldName}_time", $params), TRUE)
); );
} }
else{ else {
if (isset($specs['default'])) { if (isset($specs['default'])) {
$params[$fieldName] = date('YmdHis', strtotime($specs['default'])); $params[$fieldName] = date('YmdHis', strtotime($specs['default']));
} }
...@@ -1698,7 +1698,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { ...@@ -1698,7 +1698,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
* @return array * @return array
*/ */
public function getProfileDefaults($profile_id = 'Billing', $contactID = NULL) { public function getProfileDefaults($profile_id = 'Billing', $contactID = NULL) {
try{ try {
$defaults = civicrm_api3('profile', 'getsingle', array( $defaults = civicrm_api3('profile', 'getsingle', array(
'profile_id' => (array) $profile_id, 'profile_id' => (array) $profile_id,
'contact_id' => $contactID, 'contact_id' => $contactID,
......
...@@ -162,7 +162,7 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser { ...@@ -162,7 +162,7 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser {
$this->_params['skipRecentView'] = TRUE; $this->_params['skipRecentView'] = TRUE;
$this->_params['check_permissions'] = TRUE; $this->_params['check_permissions'] = TRUE;
$this->_params['entity_id'] = $formatted['id']; $this->_params['entity_id'] = $formatted['id'];
try{ try {
civicrm_api3('custom_value', 'create', $this->_params); civicrm_api3('custom_value', 'create', $this->_params);
} }
catch(CiviCRM_API3_Exception $e) { catch(CiviCRM_API3_Exception $e) {
......
...@@ -98,7 +98,7 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus { ...@@ -98,7 +98,7 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus {
if (!empty($params['id'])) { if (!empty($params['id'])) {
$ids['membershipStatus'] = $params['id']; $ids['membershipStatus'] = $params['id'];
} }
else{ else {
//don't allow duplicate names - if id not set //don't allow duplicate names - if id not set
$status = new CRM_Member_DAO_MembershipStatus(); $status = new CRM_Member_DAO_MembershipStatus();
$status->name = $params['name']; $status->name = $params['name'];
......
...@@ -112,7 +112,7 @@ class CRM_Member_Form_MembershipStatus extends CRM_Member_Form_MembershipConfig ...@@ -112,7 +112,7 @@ class CRM_Member_Form_MembershipStatus extends CRM_Member_Form_MembershipConfig
*/ */
public function postProcess() { public function postProcess() {
if ($this->_action & CRM_Core_Action::DELETE) { if ($this->_action & CRM_Core_Action::DELETE) {
try{ try {
CRM_Member_BAO_MembershipStatus::del($this->_id); CRM_Member_BAO_MembershipStatus::del($this->_id);
} }
catch(CRM_Core_Exception $e) { catch(CRM_Core_Exception $e) {
......
...@@ -294,7 +294,7 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form_MembershipConfig { ...@@ -294,7 +294,7 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form_MembershipConfig {
*/ */
public function postProcess() { public function postProcess() {
if ($this->_action & CRM_Core_Action::DELETE) { if ($this->_action & CRM_Core_Action::DELETE) {
try{ try {
CRM_Member_BAO_MembershipType::del($this->_id); CRM_Member_BAO_MembershipType::del($this->_id);
} }
catch(CRM_Core_Exception $e) { catch(CRM_Core_Exception $e) {
......
...@@ -134,7 +134,7 @@ class CRM_Member_Form_Task_Label extends CRM_Member_Form_Task { ...@@ -134,7 +134,7 @@ class CRM_Member_Form_Task_Label extends CRM_Member_Form_Task {
$labelRows[$id] = $rows[$membership['contact_id']]; $labelRows[$id] = $rows[$membership['contact_id']];
} }
} }
else{ else {
$labelRows = $rows; $labelRows = $rows;
} }
//call function to create labels //call function to create labels
......
...@@ -255,7 +255,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { ...@@ -255,7 +255,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
* @return boolean the result of this processing * @return boolean the result of this processing
*/ */
public function import($onDuplicate, &$values) { public function import($onDuplicate, &$values) {
try{ try {
// first make sure this is a valid line // first make sure this is a valid line
$response = $this->summary($values); $response = $this->summary($values);
if ($response != CRM_Import_Parser::VALID) { if ($response != CRM_Import_Parser::VALID) {
......
...@@ -393,11 +393,11 @@ ALTER TABLE civicrm_dashboard ...@@ -393,11 +393,11 @@ ALTER TABLE civicrm_dashboard
self::setContactImageUrl($dao->id, self::setContactImageUrl($dao->id,
CRM_Utils_System::url('civicrm/contact/imagefile', 'photo=' . $photo, TRUE, NULL, TRUE, TRUE)); CRM_Utils_System::url('civicrm/contact/imagefile', 'photo=' . $photo, TRUE, NULL, TRUE, TRUE));
} }
else{ else {
$failures[$dao->id] = $dao->image_url; $failures[$dao->id] = $dao->image_url;
} }
} }
else{ else {
$failures[$dao->id] = $dao->image_url; $failures[$dao->id] = $dao->image_url;
} }
} }
......
...@@ -683,7 +683,7 @@ WHERE cpf.price_set_id = %1 ...@@ -683,7 +683,7 @@ WHERE cpf.price_set_id = %1
if (isset($result->price_set_id)) { if (isset($result->price_set_id)) {
$priceSetId = $result->price_set_id; $priceSetId = $result->price_set_id;
} }
else{ else {
$defaultPriceSets = CRM_Price_BAO_PriceSet::getDefaultPriceSet(); $defaultPriceSets = CRM_Price_BAO_PriceSet::getDefaultPriceSet();
foreach ($defaultPriceSets as $key => $pSet) { foreach ($defaultPriceSets as $key => $pSet) {
if ($pSet['name'] == 'contribution_amount') { if ($pSet['name'] == 'contribution_amount') {
......
...@@ -207,7 +207,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { ...@@ -207,7 +207,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase {
array(1 => $email) array(1 => $email)
); );
} }
else{ else {
$errors[$emailName] = ts('This email %1 is already registered. Please select another email.', $errors[$emailName] = ts('This email %1 is already registered. Please select another email.',
array(1 => $email) array(1 => $email)
); );
...@@ -473,7 +473,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { ...@@ -473,7 +473,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase {
if (!$contactID) { if (!$contactID) {
return FALSE; return FALSE;
} }
else{//success else { //success
if ($loadCMSBootstrap) { if ($loadCMSBootstrap) {
$bootStrapParams = array(); $bootStrapParams = array();
if ($name && $password) { if ($name && $password) {
......
...@@ -1695,7 +1695,7 @@ class CRM_Utils_Token { ...@@ -1695,7 +1695,7 @@ class CRM_Utils_Token {
break; break;
case 'fee': case 'fee':
try{ try {
$value = civicrm_api3('membership_type', 'getvalue', array('id' => $membership['membership_type_id'], 'return' => 'minimum_fee')); $value = civicrm_api3('membership_type', 'getvalue', array('id' => $membership['membership_type_id'], 'return' => 'minimum_fee'));
} }
catch (CiviCRM_API3_Exception $e) { catch (CiviCRM_API3_Exception $e) {
......
...@@ -126,7 +126,7 @@ function civicrm_api3_constant_get($params) { ...@@ -126,7 +126,7 @@ function civicrm_api3_constant_get($params) {
} }
return civicrm_api3_create_success($values, $params, 'constant'); return civicrm_api3_create_success($values, $params, 'constant');
} }
else{ else {
$values = call_user_func(array('CRM_Utils_PseudoConstant', 'getConstant'), $name); $values = call_user_func(array('CRM_Utils_PseudoConstant', 'getConstant'), $name);
if (!empty($values)) { if (!empty($values)) {
return civicrm_api3_create_success($values, $params, 'constant'); return civicrm_api3_create_success($values, $params, 'constant');
......
...@@ -208,7 +208,7 @@ function civicrm_api3_custom_value_get($params) { ...@@ -208,7 +208,7 @@ function civicrm_api3_custom_value_get($params) {
$n = 0; $n = 0;
$id = $fieldNumber; $id = $fieldNumber;
} }
else{ else {
$n = $idArray[2]; $n = $idArray[2];
$id = $fieldNumber . "." . $idArray[2]; $id = $fieldNumber . "." . $idArray[2];
} }
......
...@@ -53,7 +53,7 @@ function civicrm_api3_entity_tag_get($params) { ...@@ -53,7 +53,7 @@ function civicrm_api3_entity_tag_get($params) {
if (empty($params['entity_id'])) { if (empty($params['entity_id'])) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
} }
else{ else {
//do legacy non-standard behaviour //do legacy non-standard behaviour
$values = CRM_Core_BAO_EntityTag::getTag($params['entity_id'], $params['entity_table']); $values = CRM_Core_BAO_EntityTag::getTag($params['entity_id'], $params['entity_table']);
$result = array(); $result = array();
......
...@@ -71,7 +71,7 @@ function civicrm_api3_generic_getfields($apiRequest) { ...@@ -71,7 +71,7 @@ function civicrm_api3_generic_getfields($apiRequest) {
$metadata['id']['api.aliases'] = array($lcase_entity . '_id'); $metadata['id']['api.aliases'] = array($lcase_entity . '_id');
} }
} }
else{ else {
// really the preference would be to set the unique name in the xml // really the preference would be to set the unique name in the xml
// question is which is a less risky fix this close to a release - setting in xml for the known failure // question is which is a less risky fix this close to a release - setting in xml for the known failure
// (note) or setting for all api where fields is returning 'id' & we want to accept 'note_id' @ the api layer // (note) or setting for all api where fields is returning 'id' & we want to accept 'note_id' @ the api layer
......
...@@ -88,7 +88,7 @@ function civicrm_api3_option_value_delete($params) { ...@@ -88,7 +88,7 @@ function civicrm_api3_option_value_delete($params) {
civicrm_api('option_value', 'getfields', array('version' => 3, 'cache_clear' => 1, 'option_group_id' => $optionGroupID)); civicrm_api('option_value', 'getfields', array('version' => 3, 'cache_clear' => 1, 'option_group_id' => $optionGroupID));
return civicrm_api3_create_success(); return civicrm_api3_create_success();
} }
else{ else {
civicrm_api3_create_error('Could not delete OptionValue ' . $params['id']); civicrm_api3_create_error('Could not delete OptionValue ' . $params['id']);
} }
} }
...@@ -124,7 +124,7 @@ function civicrm_api3_profile_get($params) { ...@@ -124,7 +124,7 @@ function civicrm_api3_profile_get($params) {
$values[$profileID][strtolower($fieldName)] = $field; $values[$profileID][strtolower($fieldName)] = $field;
} }
} }
else{ else {
$values[$profileID] = array_fill_keys(array_keys($profileFields), ''); $values[$profileID] = array_fill_keys(array_keys($profileFields), '');
} }
} }
...@@ -450,7 +450,7 @@ function _civicrm_api3_profile_getbillingpseudoprofile(&$params) { ...@@ -450,7 +450,7 @@ function _civicrm_api3_profile_getbillingpseudoprofile(&$params) {
$values['billing_' . $fieldname . '-' . $locationTypeID] = isset($result['api.address.get.2']['values'][0][$fieldname]) ? $result['api.address.get.2']['values'][0][$fieldname] : ''; $values['billing_' . $fieldname . '-' . $locationTypeID] = isset($result['api.address.get.2']['values'][0][$fieldname]) ? $result['api.address.get.2']['values'][0][$fieldname] : '';
} }
} }
else{ else {
foreach ($addressFields as $fieldname) { foreach ($addressFields as $fieldname) {
$values['billing_' . $fieldname . '-' . $locationTypeID] = isset($result[$fieldname]) ? $result[$fieldname] : ''; $values['billing_' . $fieldname . '-' . $locationTypeID] = isset($result[$fieldname]) ? $result[$fieldname] : '';
} }
...@@ -462,7 +462,7 @@ function _civicrm_api3_profile_getbillingpseudoprofile(&$params) { ...@@ -462,7 +462,7 @@ function _civicrm_api3_profile_getbillingpseudoprofile(&$params) {
elseif(!empty($result['api.email.get.2']['count'])) { elseif(!empty($result['api.email.get.2']['count'])) {
$values['billing-email' . '-' . $locationTypeID] = $result['api.email.get.2']['values'][0]['email']; $values['billing-email' . '-' . $locationTypeID] = $result['api.email.get.2']['values'][0]['email'];
} }
else{ else {
$values['billing-email' . '-' . $locationTypeID] = $result['email']; $values['billing-email' . '-' . $locationTypeID] = $result['email'];
} }
// return both variants of email to reflect inconsistencies in form layer // return both variants of email to reflect inconsistencies in form layer
...@@ -567,7 +567,7 @@ function _civicrm_api3_buildprofile_submitfields($profileID, $optionsBehaviour = ...@@ -567,7 +567,7 @@ function _civicrm_api3_buildprofile_submitfields($profileID, $optionsBehaviour =
// which entity 'status_id' belongs to // which entity 'status_id' belongs to
$fieldName = $entityGetFieldsResult[$realName]['uniqueName']; $fieldName = $entityGetFieldsResult[$realName]['uniqueName'];
} }
else{ else {
if (isset($entityGetFieldsResult[$realName]['name'])) { if (isset($entityGetFieldsResult[$realName]['name'])) {
// this will sort out membership_type_id vs membership_type // this will sort out membership_type_id vs membership_type
$fieldName = $entityGetFieldsResult[$realName]['name']; $fieldName = $entityGetFieldsResult[$realName]['name'];
...@@ -638,7 +638,7 @@ function _civicrm_api3_map_profile_fields_to_entity(&$field) { ...@@ -638,7 +638,7 @@ function _civicrm_api3_map_profile_fields_to_entity(&$field) {
if ($fieldName == 'email') { if ($fieldName == 'email') {
$entity = 'email'; $entity = 'email';
} }
else{ else {
$entity = 'address'; $entity = 'address';
} }
$fieldName .= '-' . $field['location_type_id']; $fieldName .= '-' . $field['location_type_id'];
......
...@@ -96,7 +96,7 @@ function civicrm_api3_setting_getdefaults(&$params) { ...@@ -96,7 +96,7 @@ function civicrm_api3_setting_getdefaults(&$params) {
if (array_key_exists('default', $spec) && !is_null($spec['default'])) { if (array_key_exists('default', $spec) && !is_null($spec['default'])) {
$defaults[$domainID][$setting] = $spec['default']; $defaults[$domainID][$setting] = $spec['default'];
} }
else{ else {
$noDefaults[$setting] = 1; $noDefaults[$setting] = 1;
} }
} }
...@@ -343,14 +343,14 @@ function _civicrm_api3_setting_getDomainArray(&$params) { ...@@ -343,14 +343,14 @@ function _civicrm_api3_setting_getDomainArray(&$params) {
if (isset($domainAPIResult['values'])) { if (isset($domainAPIResult['values'])) {
$params['domain_id'] = array_keys($domainAPIResult['values']); $params['domain_id'] = array_keys($domainAPIResult['values']);
} }
else{ else {
throw new Exception('All domains not retrieved - problem with Domain Get api call ' . $domainAPIResult['error_message']); throw new Exception('All domains not retrieved - problem with Domain Get api call ' . $domainAPIResult['error_message']);
} }
} }
if (is_array($params['domain_id'])) { if (is_array($params['domain_id'])) {
$domains = $params['domain_id']; $domains = $params['domain_id'];
} }
else{ else {
$domains = array($params['domain_id']); $domains = array($params['domain_id']);
} }
return $domains; return $domains;
......
...@@ -1888,7 +1888,7 @@ function _civicrm_api3_validate_string(&$params, &$fieldName, &$fieldInfo, $enti ...@@ -1888,7 +1888,7 @@ function _civicrm_api3_validate_string(&$params, &$fieldName, &$fieldInfo, $enti
if (!is_array($value)) { if (!is_array($value)) {
$value = (string) $value; $value = (string) $value;
} }
else{ else {
//@todo what do we do about passed in arrays. For many of these fields //@todo what do we do about passed in arrays. For many of these fields
// the missing piece of functionality is separating them to a separated string // the missing piece of functionality is separating them to a separated string
// & many save incorrectly. But can we change them wholesale? // & many save incorrectly. But can we change them wholesale?
......
...@@ -39,7 +39,7 @@ $log = new CRM_Utils_SystemLogger(); ...@@ -39,7 +39,7 @@ $log = new CRM_Utils_SystemLogger();
$log->alert('payment_notification processor_name=AuthNet', $_REQUEST); $log->alert('payment_notification processor_name=AuthNet', $_REQUEST);
$authorizeNetIPN = new CRM_Core_Payment_AuthorizeNetIPN($_REQUEST); $authorizeNetIPN = new CRM_Core_Payment_AuthorizeNetIPN($_REQUEST);
try{ try {
$authorizeNetIPN->main(); $authorizeNetIPN->main();
} }
catch(CRM_Core_Exception $e) { catch(CRM_Core_Exception $e) {
......
...@@ -48,7 +48,7 @@ else { ...@@ -48,7 +48,7 @@ else {
$paypalIPN = new CRM_Core_Payment_PayPalIPN(); $paypalIPN = new CRM_Core_Payment_PayPalIPN();
// @todo upgrade standard per Pro // @todo upgrade standard per Pro
} }
try{ try {
$paypalIPN->main(); $paypalIPN->main();
} }
catch(CRM_Core_Exception $e) { catch(CRM_Core_Exception $e) {
......
...@@ -153,7 +153,7 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase { ...@@ -153,7 +153,7 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase {
public function testIPNPaymentExpressNoError() { public function testIPNPaymentExpressNoError() {
$this->setupRecurringPaymentProcessorTransaction(); $this->setupRecurringPaymentProcessorTransaction();
$paypalIPN = new CRM_Core_Payment_PayPalProIPN($this->getPaypalExpressTransactionIPN()); $paypalIPN = new CRM_Core_Payment_PayPalProIPN($this->getPaypalExpressTransactionIPN());
try{ try {
$paypalIPN->main(); $paypalIPN->main();
} }
catch(CRM_Core_Exception $e) { catch(CRM_Core_Exception $e) {
......
...@@ -135,7 +135,7 @@ class api_v3_APITest extends CiviUnitTestCase { ...@@ -135,7 +135,7 @@ class api_v3_APITest extends CiviUnitTestCase {
* Test that calling via wrapper works * Test that calling via wrapper works
*/ */
public function testv3Wrapper() { public function testv3Wrapper() {
try{ try {
$result = civicrm_api3('contact', 'get', array()); $result = civicrm_api3('contact', 'get', array());
} }
catch (CRM_Exception $e) { catch (CRM_Exception $e) {
...@@ -149,7 +149,7 @@ class api_v3_APITest extends CiviUnitTestCase { ...@@ -149,7 +149,7 @@ class api_v3_APITest extends CiviUnitTestCase {
* Test exception is thrown * Test exception is thrown
*/ */
public function testv3WrapperException() { public function testv3WrapperException() {
try{ try {
$result = civicrm_api3('contact', 'create', array('debug' => 1)); $result = civicrm_api3('contact', 'create', array('debug' => 1));
} }
catch (CiviCRM_API3_Exception $e) { catch (CiviCRM_API3_Exception $e) {
......
...@@ -1018,7 +1018,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { ...@@ -1018,7 +1018,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
if ($specs['FKClassName'] == $baoString) { if ($specs['FKClassName'] == $baoString) {
$entity[$fieldName] = (string) $entity2['id']; $entity[$fieldName] = (string) $entity2['id'];
} }
else{ else {
$uniqueName = CRM_Utils_Array::value('uniqueName', $specs); $uniqueName = CRM_Utils_Array::value('uniqueName', $specs);
if (!empty($entity[$fieldName])) { if (!empty($entity[$fieldName])) {
$resetFKTo = array($fieldName => $entity[$fieldName]); $resetFKTo = array($fieldName => $entity[$fieldName]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment