From 37375ec357c090a49cf2a46017179cc1220de065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 13 Nov 2014 18:14:38 +0100 Subject: [PATCH] set required to false refs #301 --- CustomFields/CustomFieldChoice.php | 2 +- CustomFields/CustomFieldText.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CustomFields/CustomFieldChoice.php b/CustomFields/CustomFieldChoice.php index 4e78a1542..b6c7eba8b 100644 --- a/CustomFields/CustomFieldChoice.php +++ b/CustomFields/CustomFieldChoice.php @@ -80,7 +80,7 @@ class CustomFieldChoice implements CustomFieldInterface $options = array( 'multiple' => $customField->getOptions()[self::MULTIPLE], 'choices' => $choices, - 'required' => (count($choices) > 1) ? true : false //not required if only one + 'required' => false ); //if allow_other = true diff --git a/CustomFields/CustomFieldText.php b/CustomFields/CustomFieldText.php index 11c029ccb..966c1c194 100644 --- a/CustomFields/CustomFieldText.php +++ b/CustomFields/CustomFieldText.php @@ -50,7 +50,8 @@ class CustomFieldText implements CustomFieldInterface : 'textarea'; $builder->add($customField->getSlug(), $type, array( - 'label' => $customField->getName()[$this->requestStack->getCurrentRequest()->getLocale()] + 'label' => $customField->getName()[$this->requestStack->getCurrentRequest()->getLocale()], + 'required' => false )); }