From 491c68acc31c4188fa7fa81dbd29d1e813b3efdb Mon Sep 17 00:00:00 2001 From: yashodha Date: Thu, 27 Aug 2015 09:50:55 +0530 Subject: [PATCH] CRM-17069: Search for Contribution with campaign causes fatal error ---------------------------------------- * CRM-17069: Search for Contribution with campaign causes fatal error https://issues.civicrm.org/jira/browse/CRM-17069 --- CRM/Activity/BAO/Query.php | 3 +++ CRM/Campaign/BAO/Query.php | 7 ------- CRM/Contribute/BAO/Query.php | 3 +++ CRM/Event/BAO/Query.php | 3 +++ CRM/Member/BAO/Query.php | 3 +++ CRM/Pledge/BAO/Query.php | 3 +++ 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CRM/Activity/BAO/Query.php b/CRM/Activity/BAO/Query.php index 4050e32cfe..1ff7f51485 100644 --- a/CRM/Activity/BAO/Query.php +++ b/CRM/Activity/BAO/Query.php @@ -301,6 +301,9 @@ class CRM_Activity_BAO_Query { break; case 'activity_campaign_id': + if (CRM_Utils_Array::value($op, $value)) { + $value = $value[$op]; + } $campParams = array( 'op' => $op, 'campaign' => $value, diff --git a/CRM/Campaign/BAO/Query.php b/CRM/Campaign/BAO/Query.php index a6e7b2f090..cf7e04993e 100755 --- a/CRM/Campaign/BAO/Query.php +++ b/CRM/Campaign/BAO/Query.php @@ -603,13 +603,6 @@ INNER JOIN civicrm_custom_group grp on fld.custom_group_id = grp.id $campaignIds[$campId] = $campId; $campaignTitles[$campId] = $allCampaigns[$campId]; } - if (count($campaignIds) > 1) { - $op = 'IN'; - $campaignIds = '(' . implode(',', $campaignIds) . ')'; - } - else { - $campaignIds = reset($campaignIds); - } } else { $campaignIds = $campaign; diff --git a/CRM/Contribute/BAO/Query.php b/CRM/Contribute/BAO/Query.php index 22b57c8001..dc187abc1e 100644 --- a/CRM/Contribute/BAO/Query.php +++ b/CRM/Contribute/BAO/Query.php @@ -503,6 +503,9 @@ class CRM_Contribute_BAO_Query { return; case 'contribution_campaign_id': + if (CRM_Utils_Array::value($op, $value)) { + $value = $value[$op]; + } $campParams = array( 'op' => $op, 'campaign' => $value, diff --git a/CRM/Event/BAO/Query.php b/CRM/Event/BAO/Query.php index 16dea8eed8..578bbf8c27 100644 --- a/CRM/Event/BAO/Query.php +++ b/CRM/Event/BAO/Query.php @@ -413,6 +413,9 @@ class CRM_Event_BAO_Query { return; case 'participant_campaign_id': + if (CRM_Utils_Array::value($op, $value)) { + $value = $value[$op]; + } $campParams = array( 'op' => $op, 'campaign' => $value, diff --git a/CRM/Member/BAO/Query.php b/CRM/Member/BAO/Query.php index 4f003fcf4c..f2441ff73f 100644 --- a/CRM/Member/BAO/Query.php +++ b/CRM/Member/BAO/Query.php @@ -292,6 +292,9 @@ class CRM_Member_BAO_Query { return; case 'member_campaign_id': + if (CRM_Utils_Array::value($op, $value)) { + $value = $value[$op]; + } $campParams = array( 'op' => $op, 'campaign' => $value, diff --git a/CRM/Pledge/BAO/Query.php b/CRM/Pledge/BAO/Query.php index 446ff49d93..1dee9e5852 100644 --- a/CRM/Pledge/BAO/Query.php +++ b/CRM/Pledge/BAO/Query.php @@ -350,6 +350,9 @@ class CRM_Pledge_BAO_Query { return; case 'pledge_campaign_id': + if (CRM_Utils_Array::value($op, $value)) { + $value = $value[$op]; + } $campParams = array( 'op' => $op, 'campaign' => $value, -- 2.25.1