Commit e147d7fd authored by Maik Messerschmidt's avatar Maik Messerschmidt
Browse files

Improved CSV-Export of non-string values.

parent 0a1f6aeb
......@@ -130,10 +130,11 @@ class ResultController extends Controller
->map(function($row) use ($header, $id_header, $id_format, $id) {
foreach ($header as $key) {
// Fill empty columns with N/A
$row[$key] = $row[$key] ?? config('experiment.n-a-text');
// Replace arrays with json
if (is_array($row[$key]))
if ($row[$key] === null)
$row[$key] = config('experiment.n-a-text');
else if (is_string($row[$key]))
; // pass
$row[$key] = json_encode($row[$key]);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment