0
votes

The form's client data is expected to be of type scalar, but is an instance of class Doctrine\ORM\PersistentCollection. You can avoid this error by setting the "data_class" option to "Doctrine\ORM\PersistentCollection" or by adding a client transformer that transforms Doctrine\ORM\PersistentCollection to scalar.

Here's what I got when using a form using collections,

I've put the concerned files under Gist, i removed all unecessary code : https://gist.github.com/2769672

I'm working on a TeamType form, (class Team), I have 2 collections fields "Conditions" and "Links"

This problem happened just after i ran composer.phar update (I use Symfony 2.1).

What I don't understand is why i'm getting this although i have the "data_class" options

Thanks

1
2.1 is not yet officially released - I'd expect it to be buggy. - Peter Bailey
y, but all PR are travis-ci tested, so there should not have major bug introduced in PR. - sf_tristanb

1 Answers