From 86845f9b02ef7704e46c756323fe4b53ed78acb1 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 5 Aug 2013 13:44:49 +1200 Subject: [PATCH] CRM-13155 fix search to join direct from contact when in contact context --- CRM/Contribute/BAO/Query.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CRM/Contribute/BAO/Query.php b/CRM/Contribute/BAO/Query.php index 55d9baa80b..489da5347e 100644 --- a/CRM/Contribute/BAO/Query.php +++ b/CRM/Contribute/BAO/Query.php @@ -601,7 +601,13 @@ class CRM_Contribute_BAO_Query { break; case 'civicrm_contribution_recur': - $from = " $side JOIN civicrm_contribution_recur ON civicrm_contribution.contribution_recur_id = civicrm_contribution_recur.id "; + if ($mode == 1) { + // in contact mode join directly onto profile - in case no contributions exist yet + $from = " $side JOIN civicrm_contribution_recur ON contact_a.id = civicrm_contribution_recur.contact_id "; + } + else { + $from = " $side JOIN civicrm_contribution_recur ON civicrm_contribution.contribution_recur_id = civicrm_contribution_recur.id "; + } break; case 'civicrm_financial_type': -- 2.25.1