From: Edsel Date: Tue, 8 Mar 2016 13:19:23 +0000 (+0530) Subject: CRM-16526 CIVI-3 Fixed Jenkins test failure X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f4a331f471ce38d7e6355e75718269dd2bfba984;p=civicrm-core.git CRM-16526 CIVI-3 Fixed Jenkins test failure ---------------------------------------- * CRM-16526: ACLs for Financial Types https://issues.civicrm.org/jira/browse/CRM-16526 --- diff --git a/api/v3/Contribution.php b/api/v3/Contribution.php index 6ab0c195e8..acc2f5887e 100644 --- a/api/v3/Contribution.php +++ b/api/v3/Contribution.php @@ -52,10 +52,7 @@ function civicrm_api3_contribution_create(&$params) { } else { if (empty($params['financial_type_id'])) { - $params['financial_type_id'] = civicrm_api3('Contribution', 'getvalue', array( - 'id' => $params['id'], - 'return' => 'financial_type_id', - )); + $params['financial_type_id'] = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $params['id'], 'financial_type_id'); } $op = CRM_Core_Action::UPDATE; } diff --git a/tests/phpunit/api/v3/FinancialTypeACLTest.php b/tests/phpunit/api/v3/FinancialTypeACLTest.php index d8b29c1e4a..c9ee3af7b2 100644 --- a/tests/phpunit/api/v3/FinancialTypeACLTest.php +++ b/tests/phpunit/api/v3/FinancialTypeACLTest.php @@ -116,7 +116,8 @@ class api_v3_FinancialTypeACLTest extends CiviUnitTestCase { } public function setACL() { - CRM_Financial_BAO_FinancialType::$_availableFinancialTypes = NULL; + CRM_Financial_BAO_FinancialType::$_availableFinancialTypes = array(); + CRM_Financial_BAO_FinancialType::$_statusACLFt = array(); $params = array( 'domain_id' => 1, 'contribution_invoice_settings' => array('acl_financial_type' => 1), @@ -315,7 +316,7 @@ class api_v3_FinancialTypeACLTest extends CiviUnitTestCase { ); $contribution = $this->callAPIFailure('Contribution', 'create', $params); - $config->userPermissionClass->permissions[3] = 'edit contributions of type Donation'; + $config->userPermissionClass->permissions[] = 'edit contributions of type Donation'; $contribution = $this->callAPISuccess('Contribution', 'create', $params); $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 200.00);