diff --git a/src/FieldType/DBBaseResource.php b/src/FieldType/DBBaseResource.php index b964b17..30d9175 100644 --- a/src/FieldType/DBBaseResource.php +++ b/src/FieldType/DBBaseResource.php @@ -68,6 +68,17 @@ abstract class DBBaseResource extends DBText */ protected $asset = null; + /** + * Only show as exists if the JSON is valid. + * @todo: Use `json_validate()` once it exists maybe?? + * + * {@inheritdoc} + */ + public function exists() + { + return parent::exists() && $this->getJSON(); + } + /** * @return stdClass */ @@ -115,7 +126,7 @@ protected function convertRawTransformations($transformation) return $carry; }, []); } - + /** * @param string $abbr * @return string