From fa00d91fe3aaa84023d176ab1567dd4a26986b73 Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 8 Oct 2020 09:48:00 +1300 Subject: [PATCH] dev/core#2073 Fix use of legacy leaky method in tested code Overview ---------------------------------------- Fix use of legacy leaky method in tested code Before ---------------------------------------- After ---------------------------------------- Technical Details ---------------------------------------- Has test cover in CRM_Member_Form_MembershipTest.testSubmitUpdateMembershipFromPartiallyPaid CRM_Member_Form_MembershipTest.testMembershipViewContributionOwnerDifferent Comments ---------------------------------------- --- CRM/Contribute/BAO/Contribution.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index c279e4df90..e931c645dd 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -2270,8 +2270,7 @@ LEFT JOIN civicrm_contribution contribution ON ( componentPayment.contribution_ WHERE membership_id=$membership->id ORDER BY id DESC LIMIT 1;"; - $dao = new CRM_Core_DAO(); - $dao->query($sql); + $dao = CRM_Core_DAO::executeQuery($sql); if ($dao->fetch()) { if (!empty($dao->membership_type_id)) { $membership->membership_type_id = $dao->membership_type_id; -- 2.25.1