Skip to content

Commit

Permalink
Fix json select field
Browse files Browse the repository at this point in the history
  • Loading branch information
sohelamin committed Oct 25, 2017
1 parent cc5d56c commit 61b6f6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Commands/CrudApiCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ protected function processJSONFields($file)
$fieldsString = '';
foreach ($fields->fields as $field) {
if ($field->type == 'select') {
$fieldsString .= $field->name . '#' . $field->type . '#options=' . implode(',', $field->options) . ';';
$fieldsString .= $field->name . '#' . $field->type . '#options=' . json_encode($field->options) . ';';
} else {
$fieldsString .= $field->name . '#' . $field->type . ';';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/CrudCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ protected function processJSONFields($file)
$fieldsString = '';
foreach ($fields->fields as $field) {
if ($field->type == 'select') {
$fieldsString .= $field->name . '#' . $field->type . '#options=' . implode(',', (array) $field->options) . ';';
$fieldsString .= $field->name . '#' . $field->type . '#options=' . json_encode($field->options) . ';';
} else {
$fieldsString .= $field->name . '#' . $field->type . ';';
}
Expand Down

0 comments on commit 61b6f6c

Please sign in to comment.