validate color (#2072)

This commit is contained in:
Kevin Papst
2020-10-28 20:01:08 +01:00
committed by GitHub
parent 82e1d6b917
commit 1444593bbd
8 changed files with 189 additions and 14 deletions

View File

@@ -21,9 +21,10 @@ trait EntityFormTrait
{
public function addCommonFields(FormBuilderInterface $builder, array $options): void
{
$currency = $options['currency'];
$builder
->add('color', ColorPickerType::class)
->add('color', ColorPickerType::class, [
'required' => false,
])
;
if ($options['include_budget']) {
@@ -32,7 +33,7 @@ trait EntityFormTrait
'empty_data' => '0.00',
'label' => 'label.budget',
'required' => false,
'currency' => $currency,
'currency' => $options['currency'],
])
->add('timeBudget', DurationType::class, [
'empty_data' => 0,