Call makeCSVTable function directly from writeRows
authoreileen <emcnaughton@wikimedia.org>
Mon, 25 Nov 2019 04:57:39 +0000 (17:57 +1300)
committereileen <emcnaughton@wikimedia.org>
Sun, 5 Apr 2020 04:28:04 +0000 (16:28 +1200)
CRM/Export/BAO/ExportProcessor.php

index fce1247c2a2d326f1fdc32a1a31a9ff1034792bb..31ad915d3e2d6ba2a63f1cc223e2550be4d1f71d 100644 (file)
@@ -2360,15 +2360,15 @@ LIMIT $offset, $limit
   }
 
   /**
+   * Write rows to the csv.
+   *
    * @param array $headerRows
-   * @param array $componentDetails
+   * @param array $rows
    */
-  protected function writeRows(array $headerRows, array $componentDetails) {
-    CRM_Core_Report_Excel::writeCSVFile($this->getExportFileName(),
-      $headerRows,
-      $componentDetails,
-      FALSE
-    );
+  protected function writeRows(array $headerRows, array $rows) {
+    if (!empty($rows)) {
+      CRM_Core_Report_Excel::makeCSVTable($headerRows, $rows, FALSE);
+    }
   }
 
   /**