diff --git a/CRM/Contribute/Page/ManagePremiums.php b/CRM/Contribute/Page/ManagePremiums.php index 94859108a464..65fb5952587c 100644 --- a/CRM/Contribute/Page/ManagePremiums.php +++ b/CRM/Contribute/Page/ManagePremiums.php @@ -152,7 +152,7 @@ public function browse() { ); // Financial Type if (!empty($dao->financial_type_id)) { - $premiums[$dao->id]['financial_type'] = CRM_Core_PseudoConstant::getLabel('CRM_Financial_BAO_FinancialType', 'financial_type', $dao->financial_type_id); + $premiums[$dao->id]['financial_type'] = CRM_Core_PseudoConstant::getLabel('CRM_Contribute_BAO_Product', 'financial_type_id', $dao->financial_type_id); } } $this->assign('rows', $premiums); diff --git a/CRM/Contribute/Page/Premium.php b/CRM/Contribute/Page/Premium.php index 61d8cfb4f61c..a24eb3960cc4 100644 --- a/CRM/Contribute/Page/Premium.php +++ b/CRM/Contribute/Page/Premium.php @@ -168,7 +168,7 @@ public function browse() { ); // Financial Type if (!empty($premiumsProductDao->financial_type_id)) { - $premiums[$productDAO->id]['financial_type'] = CRM_Core_PseudoConstant::getLabel('CRM_Financial_BAO_FinancialType', 'financial_type', $premiumsProductDao->financial_type_id); + $premiums[$productDAO->id]['financial_type'] = CRM_Core_PseudoConstant::getLabel('CRM_Contribute_BAO_Product', 'financial_type_id', $premiumsProductDao->financial_type_id); } } } diff --git a/CRM/Financial/DAO/FinancialType.php b/CRM/Financial/DAO/FinancialType.php index 0ba7aa946fc5..516fe493e833 100644 --- a/CRM/Financial/DAO/FinancialType.php +++ b/CRM/Financial/DAO/FinancialType.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Financial/FinancialType.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:2313c49e821b4a909bf3c54e72576e9b) + * (GenCodeChecksum:760550280aaa0da48232ebdfb11170f9) */ /** @@ -118,11 +118,6 @@ public static function &fields() { 'type' => 'Text', 'label' => ts("Name"), ], - 'pseudoconstant' => [ - 'table' => 'civicrm_financial_type', - 'keyColumn' => 'id', - 'labelColumn' => 'name', - ] ], 'description' => [ 'name' => 'description', diff --git a/api/v3/FinancialType.php b/api/v3/FinancialType.php index dc438dbb4603..ab13f47df485 100644 --- a/api/v3/FinancialType.php +++ b/api/v3/FinancialType.php @@ -44,8 +44,6 @@ function civicrm_api3_financial_type_create($params) { function _civicrm_api3_financial_type_create_spec(&$params) { $params['name']['api.required'] = 1; - $params['name']['type'] = CRM_Utils_Type::T_STRING; - unset($params['name']['pseudoconstant']); } /** diff --git a/tests/phpunit/api/v3/FinancialTypeTest.php b/tests/phpunit/api/v3/FinancialTypeTest.php index db5e35a5ceaf..58fe078929a6 100644 --- a/tests/phpunit/api/v3/FinancialTypeTest.php +++ b/tests/phpunit/api/v3/FinancialTypeTest.php @@ -73,12 +73,13 @@ public function testCreateUpdateFinancialTypeCustomField() { // create financial type with custom field $financialType = $this->callAPISuccess('FinancialType', 'create', array_merge($params, $customFields)); + $this->callAPISuccessGetSingle('FinancialType', ['name' => $financialTypeName]); // get financial type to check custom field value $expectedResult = array_filter(array_merge($params, $customFields), function($var) { return (!is_null($var) && $var != ''); }); - $result = $this->callAPISuccessGetSingle('FinancialType', [ + $this->callAPISuccessGetSingle('FinancialType', [ 'id' => $financialType['id'], ], $expectedResult); @@ -98,7 +99,7 @@ public function testCreateUpdateFinancialTypeCustomField() { $expectedResult = array_filter(array_merge($params, $customFields), function($var) { return (!is_null($var) && $var != ''); }); - $result = $this->callAPISuccessGetSingle('FinancialType', [ + $this->callAPISuccessGetSingle('FinancialType', [ 'id' => $financialType['id'], ], $expectedResult); } diff --git a/xml/schema/Financial/FinancialType.xml b/xml/schema/Financial/FinancialType.xml index 8e93b6c82ec3..bbdca886dae8 100644 --- a/xml/schema/Financial/FinancialType.xml +++ b/xml/schema/Financial/FinancialType.xml @@ -36,11 +36,6 @@ 1.3 - - civicrm_financial_type
- id - name -
accounting_code