From 5623cf946e3dbdbec165977e9220e504ca6b3de4 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 24 Jul 2024 11:06:30 +0200 Subject: [PATCH] Set empty_data option to allow empty array to be passed --- .../DependencyInjection/Configuration.php | 50 +++++++++---------- .../ChillMainBundle/Form/WorkflowStepType.php | 5 +- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php index 2185375b6..bf62e0322 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php @@ -85,6 +85,30 @@ class Configuration implements ConfigurationInterface ->end() ->end() ->end() // end of notifications + ->arrayNode('workflow_signature') + ->children() + ->arrayNode('base_signer') + ->children() + ->arrayNode('document_kinds') + ->arrayPrototype() + ->children() + ->scalarNode('key')->cannotBeEmpty()->end() + ->arrayNode('labels') + ->arrayPrototype() + ->children() + ->scalarNode('lang')->cannotBeEmpty()->end() + ->scalarNode('label')->cannotBeEmpty()->end() + ->end() + ->end() + ->end() + ->end() + ->end() + ->end() + ->end() + ->end() + ->end() + ->end() + ->end() // end of workflow signature document types ->arrayNode('phone_helper') ->canBeUnset() ->children() @@ -277,32 +301,6 @@ class Configuration implements ConfigurationInterface ->end() // end of root ; - $rootNode->children() - ->arrayNode('workflow_signature') - ->children() - ->arrayNode('base_signer') - ->children() - ->arrayNode('document_kinds') - ->arrayPrototype() - ->children() - ->scalarNode('key')->cannotBeEmpty()->end() - ->arrayNode('labels') - ->arrayPrototype() - ->children() - ->scalarNode('lang')->cannotBeEmpty()->end() - ->scalarNode('label')->cannotBeEmpty()->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->end(); - $rootNode->children() ->arrayNode('add_address')->addDefaultsIfNotSet()->children() ->scalarNode('default_country')->cannotBeEmpty()->defaultValue('BE')->end() diff --git a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php index 8d5f8c819..a113c62c5 100644 --- a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php +++ b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php @@ -150,7 +150,7 @@ class WorkflowStepType extends AbstractType ->add('futurePersonSignatures', PickPersonDynamicType::class, [ 'label' => 'workflow.signature_zone.person signatures', 'multiple' => true, - 'data' => [] + 'empty_data' => '[]', ]) ->add('futureUserSignature', PickUserDynamicType::class, [ 'label' => 'workflow.signature_zone.user signature', @@ -159,7 +159,7 @@ class WorkflowStepType extends AbstractType ->add('futureDestUsers', PickUserDynamicType::class, [ 'label' => 'workflow.dest for next steps', 'multiple' => true, - 'data' => [], + 'empty_data' => '[]', 'suggested' => $options['suggested_users'], ]) ->add('futureCcUsers', PickUserDynamicType::class, [ @@ -167,6 +167,7 @@ class WorkflowStepType extends AbstractType 'multiple' => true, 'required' => false, 'suggested' => $options['suggested_users'], + 'empty_data' => '[]', 'attr' => ['class' => 'future-cc-users'], ]) ->add('futureDestEmails', ChillCollectionType::class, [