CRM-17069: Search for Contribution with campaign causes fatal error
authoryashodha <yashodha.chaku@webaccessglobal.com>
Thu, 27 Aug 2015 04:20:55 +0000 (09:50 +0530)
committeryashodha <yashodha.chaku@webaccessglobal.com>
Thu, 27 Aug 2015 04:20:55 +0000 (09:50 +0530)
----------------------------------------
* CRM-17069: Search for Contribution with campaign  causes fatal error
  https://issues.civicrm.org/jira/browse/CRM-17069

CRM/Activity/BAO/Query.php
CRM/Campaign/BAO/Query.php
CRM/Contribute/BAO/Query.php
CRM/Event/BAO/Query.php
CRM/Member/BAO/Query.php
CRM/Pledge/BAO/Query.php

index 4050e32cfeece4230b3df386354bd1408513d2bd..1ff7f51485c63b2c9ab5353a2f607f030ee59a3a 100644 (file)
@@ -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,
index a6e7b2f090302fae6decf8cf64b146f3fdd6af56..cf7e04993e9b875bb4eed98a2582c3ad469b813c 100755 (executable)
@@ -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;
index 22b57c8001e441c6e47e165ca27257fed01f3fe1..dc187abc1e9e13a0989ffebb4bff67cc77a39377 100644 (file)
@@ -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,
index 16dea8eed84d05bc75202613cfa6f8b65fdb8805..578bbf8c27c29799da453b60d89028441d7e5cde 100644 (file)
@@ -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,
index 4f003fcf4c0ee9aeb8d8858ae314dfbda7ad0a1a..f2441ff73f566e6fdc82d1c0e3e087e3e75a2366 100644 (file)
@@ -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,
index 446ff49d93f3e7e8d2c880537e1c2c16a1ae2bc1..1dee9e585229238f335a66dcd45547ac61d407b7 100644 (file)
@@ -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,