mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +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
7e3295c71f
commit
2554da9dd8
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user