Skip to content
Permalink
Browse files

FIX Array to string conversion message after CSV export (#6622)

* FIX Array to string conversion message after CSV export

* Removed invalid line endings
  • Loading branch information...
jvdanker authored and dhensby committed Feb 15, 2017
1 parent 7122e1f commit 30725916dbb0ffc66b77f26c069a86581636ae55
Showing with 6 additions and 1 deletion.
  1. +6 −1 forms/gridfield/GridFieldExportButton.php
@@ -110,8 +110,13 @@ public function generateExportFileData($gridField) {
// determine the CSV headers. If a field is callable (e.g. anonymous function) then use the
// source name as the header instead
foreach($csvColumns as $columnSource => $columnHeader) {
$headers[] = (!is_string($columnHeader) && is_callable($columnHeader)) ? $columnSource : $columnHeader;
if (is_array($columnHeader) && array_key_exists('title', $columnHeader)) {
$headers[] = $columnHeader['title'];
} else {
$headers[] = (!is_string($columnHeader) && is_callable($columnHeader)) ? $columnSource : $columnHeader;
}
}
$fileData .= "\"" . implode("\"{$separator}\"", array_values($headers)) . "\"";

0 comments on commit 3072591

Please sign in to comment.
You can’t perform that action at this time.