shadypierre/VlabsMediaBundle — pull request #1 by lenybernard (2013-06-09 13:55:13+00:00)
Title: Add auto_initialize tru in BaseListener del file type to support Symfony 2.3

As explaned in Symfony 2.3 upgrade file :

* The *_SET_DATA events are now guaranteed to be fired *after* the children
were added by the FormBuilder (unless setData() is called manually). Before,
the *_SET_DATA events were sometimes thrown before adding child forms,
which made it impossible to remove child forms dynamically.

A consequence of this change is that you need to set the "auto_initialize"
option to `false` for `FormInterface` instances that you pass to
`FormInterface::add()`:

Before:

```
$form = $factory->create('form');
$form->add($factory->createNamed('field', 'text'));
```

This code will now throw an exception with the following message:

Automatic initialization is only supported on root forms. You should set the
"auto_initialize" option to false on the field "field".

Consequently, you need to set the "auto_initialize" option:

After (Alternative 1):

```
$form = $factory->create('form');
$form->add($factory->createNamed('field', 'text', array(
'auto_initialize' => false,
)));
```