From 7964faf645211077f63d6a1b51c5cd580c909215 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Mon, 10 Jan 2022 12:43:08 +0000 Subject: [PATCH] Simplify getting contact_id from recurring contribution --- CRM/Core/Payment.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index 16f4691d06..6b599e0bf3 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -1745,17 +1745,7 @@ abstract class CRM_Core_Payment { break; case 'recur': - $sql = " - SELECT DISTINCT con.contact_id - FROM civicrm_contribution_recur rec -INNER JOIN civicrm_contribution con ON ( con.contribution_recur_id = rec.id ) - WHERE rec.id = %1"; - $contactID = CRM_Core_DAO::singleValueQuery($sql, [ - 1 => [ - $entityID, - 'Integer', - ], - ]); + $contactID = CRM_Core_DAO::getFieldValue("CRM_Contribute_DAO_ContributionRecur", $entityID, "contact_id"); $entityArg = 'crid'; break; } -- 2.25.1