----------------------------------------
* CRM-20615: Export only those batches having status Exported
https://issues.civicrm.org/jira/browse/CRM-20615
else {
CRM_Core_Error::fatal("Could not locate exporter: $exporterClass");
}
+ $export = array();
foreach ($batchIds as $batchId) {
+ // export only batches whose status is set to Exported.
+ $result = civicrm_api3('Batch', 'getcount', array(
+ 'id' => $batchId,
+ 'status_id' => "Exported",
+ ));
+ if (!$result) {
+ continue;
+ }
$export[$batchId] = $exporter->generateExportQuery($batchId);
}
- $exporter->makeExport($export);
+ if ($export) {
+ $exporter->makeExport($export);
+ }
}
/**