From 43321dd545696601114bd3f4d063d665bd06db1c Mon Sep 17 00:00:00 2001 From: eileenmcnaugton Date: Wed, 2 Sep 2015 16:10:37 +1200 Subject: [PATCH] CRM-17120 swap out calls to getLabel to a cached one This change is tested in the contribution BAO class --- CRM/Contribute/BAO/Contribution.php | 2 +- tests/phpunit/CRM/Case/BAO/QueryTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 6ed0fd7e3f..0305ee83c2 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -1053,7 +1053,7 @@ GROUP BY p.id $contributionDAO->id = $honorDAO->contribution_id; if ($contributionDAO->find(TRUE)) { - $params[$contributionDAO->id]['honor_type'] = CRM_Core_OptionGroup::getLabel('soft_credit_type', $honorDAO->soft_credit_type_id, 'value'); + $params[$contributionDAO->id]['honor_type'] = CRM_Core_PseudoConstant::getLabel('CRM_Contribute_BAO_ContributionSoft', 'soft_credit_type_id', $honorDAO->soft_credit_type_id); $params[$contributionDAO->id]['honorId'] = $contributionDAO->contact_id; $params[$contributionDAO->id]['display_name'] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $contributionDAO->contact_id, 'display_name'); $params[$contributionDAO->id]['type'] = $type[$contributionDAO->financial_type_id]; diff --git a/tests/phpunit/CRM/Case/BAO/QueryTest.php b/tests/phpunit/CRM/Case/BAO/QueryTest.php index 828b534654..e11f0b5ed7 100644 --- a/tests/phpunit/CRM/Case/BAO/QueryTest.php +++ b/tests/phpunit/CRM/Case/BAO/QueryTest.php @@ -65,4 +65,5 @@ class CRM_Case_BAO_QueryTest extends CiviUnitTestCase { $queryObj->_qill[1] ); } + } -- 2.25.1