{"issue":{"created_at":"2011-12-08T12:48:50Z","state":"open","updated_at":"2011-12-08T12:48:50Z","comments":0,"user":{"gravatar_id":"97b42d474f54c38970d3ef02c98c903e","id":823072,"url":"https://api.github.com/users/drmonty","avatar_url":"https://secure.gravatar.com/avatar/97b42d474f54c38970d3ef02c98c903e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"drmonty"},"body":"(related to [#2802](https://github.com/symfony/symfony/issues/2802) from symfony)\r\n\r\n```php\r\n$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');},));\r\n```\r\n\r\nWill render all documents, that got fetched by <code>query_builder</code>, but not an empty value in select-form-field.\r\nOnly setting <code>'required' => false</code> or <code>'empty_value' => true</code> results to the same issue.\r\n\r\nTested with 2.0.6 and 2.1.0-dev (from today).\r\n\r\nadding the following to the twig-view, creates the empty value:\r\n\r\n```php\r\n{{ form_widget(form.name, { 'empty_value' : '' }) }}\r\n```\r\nbut choosing the empty value makes the form invalid.","assignee":null,"id":2487139,"labels":[],"number":62,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"[Form] \"empty_value => true\" and \"required => false\" won't render an empty value for document Field Type","html_url":"https://github.com/doctrine/DoctrineMongoDBBundle/issues/62","closed_at":null,"url":"https://api.github.com/repos/doctrine/DoctrineMongoDBBundle/issues/62","milestone":null},"action":"opened"}