Skip to content

Commit

Permalink
Update json field to handle unmutated columns
Browse files Browse the repository at this point in the history
Update json field to handle unmutated columns
  • Loading branch information
Chaddles23 authored Jan 18, 2018
1 parent b75af6d commit 8955ea4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Foundation/Forms/Fields/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ public function getFieldValue()
{
$value = parent::getFieldValue();

$json = json_encode($value);
if ( is_array($value) ) {
$value = json_encode($value);
}

return ($json && $json != 'null' && $json != '[]') ? $json : '{}';
return($value && $value != 'null' && $value != '[]') ? $value : '{}';
}
}

0 comments on commit 8955ea4

Please sign in to comment.