From 77700a50a27a8e853558a34b10d91d23511126dd Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Wed, 11 Oct 2017 12:59:03 -0600 Subject: [PATCH] Fix HTML exporter breaking with null values --- lib/reports.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/reports.php b/lib/reports.php index ed8705b..38115eb 100644 --- a/lib/reports.php +++ b/lib/reports.php @@ -208,6 +208,14 @@ function dataToODS($data, $name = "report") { } function dataToHTML($data, $name = "report") { + // HTML exporter doesn't like null values + for ($i = 0; $i < count($data); $i++) { + for ($j = 0; $j < count($data[$i]); $j++) { + if (is_null($data[$i][$j])) { + $data[$i][$j] = ''; + } + } + } header('Content-type: text/html'); $converter = new HTMLConverter(); $out = "\n"