CRM-13092
authoryashodha <yashodha.chaku@webaccess.co.in>
Wed, 31 Jul 2013 06:16:45 +0000 (11:46 +0530)
committeryashodha <yashodha.chaku@webaccess.co.in>
Wed, 31 Jul 2013 06:16:45 +0000 (11:46 +0530)
CRM/Export/BAO/Export.php

index 55e50b7c2e54198f8286f9ae46e6c3676883ddb5..f63e2d864812255b6e0153597a15031bc8a0b4a1 100644 (file)
@@ -483,15 +483,17 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c
               $component = 'civicrm_pledge';
               break;
 
-            case CRM_Export_Form_Select::CASE_EXPORT:
-              $component = 'civicrm_case';
-              break;
-
             case CRM_Export_Form_Select::GRANT_EXPORT:
               $component = 'civicrm_grant';
               break;
           }
-          $relIDs = CRM_Core_DAO::getContactIDsFromComponent($ids, $component);
+
+          if ($exportMode == CRM_Export_Form_Select::CASE_EXPORT) {
+            $relIDs = CRM_Case_BAO_Case::retrieveContactIdsByCaseId($ids);
+          }
+          else {
+            $relIDs = CRM_Core_DAO::getContactIDsFromComponent($ids, $component);
+          }
         }
 
         $relationshipJoin = $relationshipClause = '';