Skip to content

Commit

Permalink
Handle less than 3 columns selected
Browse files Browse the repository at this point in the history
  • Loading branch information
Rello committed Sep 10, 2023
1 parent c96618a commit 8662b6a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Datasource/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ public function readData($option): array

// separate the fields of the array {BTC,tmsp,price}
$paths = explode(',', $matches[0][0]);
// fill up with dummies in case of missing columns
while (count($paths) < 3) {
array_unshift($paths, 'empty');
}
foreach ($json as $rowArray) {
// get the array fields from the json
// if no match is not found, the field name will be used as a constant string
Expand Down

0 comments on commit 8662b6a

Please sign in to comment.