From 935b7314f8d8345b778e7400fb02be47a10904e0 Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Sun, 1 Jan 2023 18:29:05 +0000 Subject: [PATCH] Fix bug in CSV exports --- controllers/Builder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/Builder.php b/controllers/Builder.php index 410c5d9..c906152 100644 --- a/controllers/Builder.php +++ b/controllers/Builder.php @@ -179,7 +179,7 @@ public function view($context, $id) $csv_columns = []; $csv_headings = []; foreach ($model->csv_columns as $list_col) { - $col = $list_col['column']; + $col = is_string($list_col['column']) ? json_decode($list_col['column'], true) : $list_col['column']; $csv_columns[] = $col['key']; $csv_headings[] = $list_col['label']; } @@ -210,7 +210,7 @@ public function view($context, $id) $list_columns = []; $sort_column = ''; foreach ($model->list_columns as $list_col) { - $col = json_decode($list_col['column'], true); + $col = is_string($list_col['column']) ? json_decode($list_col['column'], true) : $list_col['column']; $list_columns[$col['key']] = [ 'title' => $list_col['label'], ];