Fix error when denormalizing empty array for pick third party dynampic type

This commit is contained in:
Julien Fastré 2024-10-15 11:06:35 +02:00
parent 13dbbb6741
commit 6cd336922f
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
2 changed files with 6 additions and 1 deletions

View File

@ -28,10 +28,14 @@ class EntityToJsonTransformer implements DataTransformerInterface
public function reverseTransform($value) public function reverseTransform($value)
{ {
if ('' === $value) { if (false === $this->multiple && '' === $value) {
return null; return null;
} }
if ($this->multiple && [] === $value) {
return [];
}
$denormalized = json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR); $denormalized = json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR);
if ($this->multiple) { if ($this->multiple) {

View File

@ -188,6 +188,7 @@ class WorkflowStepType extends AbstractType
'label' => 'workflow.transition_destinee_third_party', 'label' => 'workflow.transition_destinee_third_party',
'help' => 'workflow.transition_destinee_third_party_help', 'help' => 'workflow.transition_destinee_third_party_help',
'multiple' => true, 'multiple' => true,
'empty_data' => [],
]); ]);
$builder $builder