From a83ea1d095b24e89a052aca6ccdf8bde3d4ac217 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 25 Nov 2019 17:50:53 +1300 Subject: [PATCH] Remove titleHeader var This is never passed in, and, logically, it would break the csv if it was --- CRM/Core/Report/Excel.php | 12 +++--------- CRM/Export/BAO/ExportProcessor.php | 3 +-- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/CRM/Core/Report/Excel.php b/CRM/Core/Report/Excel.php index 18749398b3..096ae050fc 100644 --- a/CRM/Core/Report/Excel.php +++ b/CRM/Core/Report/Excel.php @@ -26,17 +26,13 @@ class CRM_Core_Report_Excel { * column headers. * @param array $rows * result set rows. - * @param string $titleHeader * @param bool $outputHeader * * @return mixed * empty if output is printed, else output * */ - public static function makeCSVTable($header, $rows, $titleHeader = NULL, $outputHeader = TRUE) { - if ($titleHeader) { - echo $titleHeader; - } + public static function makeCSVTable($header, $rows, $outputHeader = TRUE) { $config = CRM_Core_Config::singleton(); $seperator = $config->fieldSeparator; @@ -156,14 +152,12 @@ class CRM_Core_Report_Excel { * An array of the headers. * @param array $rows * An array of arrays of the table contents. - * @param string $titleHeader - * If set this will be the title in the CSV. * @param bool $outputHeader * Should we output the header row. * * @return void */ - public static function writeCSVFile($fileName, $header, $rows, $titleHeader = NULL, $outputHeader = TRUE) { + public static function writeCSVFile($fileName, $header, $rows, $outputHeader = TRUE) { if ($outputHeader) { CRM_Utils_System::download(CRM_Utils_String::munge($fileName), 'text/x-csv', @@ -174,7 +168,7 @@ class CRM_Core_Report_Excel { } if (!empty($rows)) { - return self::makeCSVTable($header, $rows, $titleHeader, $outputHeader); + return self::makeCSVTable($header, $rows, $outputHeader); } } diff --git a/CRM/Export/BAO/ExportProcessor.php b/CRM/Export/BAO/ExportProcessor.php index 8453d02475..a97d041888 100644 --- a/CRM/Export/BAO/ExportProcessor.php +++ b/CRM/Export/BAO/ExportProcessor.php @@ -2356,7 +2356,7 @@ LIMIT $offset, $limit // the Windows variant but is tested with MS Excel for Mac (Office 365 v 16.31) // and it continues to work on Libre Office, Numbers, Notes etc. echo "\xEF\xBB\xBF"; - CRM_Core_Report_Excel::makeCSVTable($headerRows, [], NULL, TRUE); + CRM_Core_Report_Excel::makeCSVTable($headerRows, [], TRUE); } /** @@ -2367,7 +2367,6 @@ LIMIT $offset, $limit CRM_Core_Report_Excel::writeCSVFile($this->getExportFileName(), $headerRows, $componentDetails, - NULL, FALSE ); } -- 2.25.1