doctrine/DoctrineMongoDBBundle — Issue #62: [Form] "empty_value => true" and "required => false" won't render an empty value for document Field Type
Author: drmonty
Created: 2011-12-08 12:48:50+00:00
State: open

(related to [#2802](https://github.com/symfony/symfony/issues/2802) from symfony)

```php
$builder->add('name', 'document', array('class' => 'test\TestBundle\Document\Name', 'multiple' => true, 'empty_value' => true, 'required' => false, 'label' => 'Name:', 'query_builder' => function(DocumentRepository $dm) { return $dm->createQueryBuilder()->sort('name', 'asc');},));
```

Will render all documents, that got fetched by query_builder, but not an empty value in select-form-field.
Only setting 'required' => false or 'empty_value' => true results to the same issue.

Tested with 2.0.6 and 2.1.0-dev (from today).

adding the following to the twig-view, creates the empty value:

```php
{{ form_widget(form.name, { 'empty_value' : '' }) }}
```
but choosing the empty value makes the form invalid.