From 0f913c6d7e13d018312f9fd485ea6ca10c4f1f37 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Fri, 3 Nov 2017 10:40:16 +1100 Subject: [PATCH] Fix Recurring contribution sql so that it doesen't use group by as there doesn't appear to be a reason to do so given that we have a where id = x clause and we were grouping on the same field --- CRM/Core/Payment.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index 822b6bcc88..f817967cca 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -1446,11 +1446,10 @@ abstract class CRM_Core_Payment { case 'recur': $sql = " - SELECT con.contact_id + 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 - GROUP BY rec.id"; + WHERE rec.id = %1"; $contactID = CRM_Core_DAO::singleValueQuery($sql, array(1 => array($entityID, 'Integer'))); $entityArg = 'crid'; break; -- 2.25.1