mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-29 18:14:59 +00:00
Fix: urgent fix for EntityToJsonTransformer
The throw on error flag imposes us to propose a valid json string for decoding
This commit is contained in:
@@ -43,6 +43,10 @@ class EntityToJsonTransformer implements DataTransformerInterface
|
|||||||
|
|
||||||
public function reverseTransform($value)
|
public function reverseTransform($value)
|
||||||
{
|
{
|
||||||
|
if ("" === $value) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$denormalized = json_decode($value, true, 512, JSON_THROW_ON_ERROR);
|
$denormalized = json_decode($value, true, 512, JSON_THROW_ON_ERROR);
|
||||||
|
|
||||||
if ($this->multiple) {
|
if ($this->multiple) {
|
||||||
@@ -56,10 +60,6 @@ class EntityToJsonTransformer implements DataTransformerInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('' === $value) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->denormalizeOne($denormalized);
|
return $this->denormalizeOne($denormalized);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user