CRM-13092
authoryashodha <yashodha.chaku@webaccess.co.in>
Mon, 29 Jul 2013 08:06:51 +0000 (13:36 +0530)
committeryashodha <yashodha.chaku@webaccess.co.in>
Mon, 29 Jul 2013 08:06:51 +0000 (13:36 +0530)
CRM/Case/BAO/Query.php

index 82b56c3774893ae5861f3a876c977f8b00554e79..8e97b6c993e5dc06eec640b7ac2c155cc298b090 100644 (file)
@@ -521,7 +521,8 @@ class CRM_Case_BAO_Query {
         break;
 
       case 'civicrm_case_reporter':
-        $from .= " $side JOIN civicrm_contact as civicrm_case_reporter ON case_activity.source_contact_id = civicrm_case_reporter.id ";
+        $from .= " $side JOIN civicrm_activity_contact as case_activity_contact ON (case_activity.id = case_activity_contact.activity_id AND  case_activity_contact.record_type_id = 2 ) ";
+        $from .= " $side JOIN civicrm_contact as civicrm_case_reporter ON case_activity_contact.contact_id = civicrm_case_reporter.id ";
         break;
 
       case 'civicrm_case':