diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php index c6839efa8..21f976a0f 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php @@ -28,10 +28,14 @@ class EntityToJsonTransformer implements DataTransformerInterface public function reverseTransform($value) { - if ('' === $value) { + if (false === $this->multiple && '' === $value) { return null; } + if ($this->multiple && [] === $value) { + return []; + } + $denormalized = json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR); if ($this->multiple) { diff --git a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php index b786a450d..1984437f8 100644 --- a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php +++ b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php @@ -188,6 +188,7 @@ class WorkflowStepType extends AbstractType 'label' => 'workflow.transition_destinee_third_party', 'help' => 'workflow.transition_destinee_third_party_help', 'multiple' => true, + 'empty_data' => [], ]); $builder