set required to false refs #301

This commit is contained in:
Julien Fastré 2014-11-13 18:14:38 +01:00
parent dcae01d860
commit 37375ec357
2 changed files with 3 additions and 2 deletions

View File

@ -80,7 +80,7 @@ class CustomFieldChoice implements CustomFieldInterface
$options = array( $options = array(
'multiple' => $customField->getOptions()[self::MULTIPLE], 'multiple' => $customField->getOptions()[self::MULTIPLE],
'choices' => $choices, 'choices' => $choices,
'required' => (count($choices) > 1) ? true : false //not required if only one 'required' => false
); );
//if allow_other = true //if allow_other = true

View File

@ -50,7 +50,8 @@ class CustomFieldText implements CustomFieldInterface
: 'textarea'; : 'textarea';
$builder->add($customField->getSlug(), $type, array( $builder->add($customField->getSlug(), $type, array(
'label' => $customField->getName()[$this->requestStack->getCurrentRequest()->getLocale()] 'label' => $customField->getName()[$this->requestStack->getCurrentRequest()->getLocale()],
'required' => false
)); ));
} }