mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +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:
parent
7e19419861
commit
24c33b306b
@ -31,6 +31,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) {
|
||||||
@ -44,10 +48,6 @@ class EntityToJsonTransformer implements DataTransformerInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('' === $value) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->denormalizeOne($denormalized);
|
return $this->denormalizeOne($denormalized);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user