symfony/symfony — pull request #3793 by Burgov (2012-04-05 14:32:54+00:00)
Title: [Form] getParent() does not receive correct options array

This PR is based on PR #3789. I wrote two tests which show exactly what functionality was broken by PR #3290. Unfortunately one of them (testChildDefaultOptionIsPassedToChildsGetParentMethod) is still broken after PR #3789.

The default options of children or even the type itself are still not passed to the getParent method, forcing users to pass these options to the factory every time they use the type. A more specific use case is when you create a type which has "choice" as it's parent. When in its default options it defines "expanded"=>true and "multiple"=>true, the getParent() of the "choice" type should always return "form", otherwise a dataMapper will never be assigned and the checkbox list shows empty, even if some values are "true".

At this moment the getParent method reads as follows:

```php
public function getParent(array $options)
{
return isset($options['expanded']) && $options['expanded'] ? 'form' : 'field';
}
```

If the option was not passed to the factory (e.g. from the controller), it seems to just assume the form is not "expanded", which sounds wrong to me.

Hopefully this test can help fix the problem!