Skip to main content

imI'm stuck with following error message on a project with symfony 2.8 and sonata admin/media bundle. iI log in sonata and navigate to the list view were iI have an edit button. iI click the edit button and get following error.

error message: The form's view data is expected to be of type scalar, array or an instance of \ArrayAccess\ArrayAccess, but is an instance of class DateTime. You can avoid this error by setting the "data_class" option to "DateTime" or by adding a view transformer that transforms an instance of class DateTime to scalar, array or an instance of \ArrayAccess\ArrayAccess.

iI found some answers via stackoverflow saying that the data_class needs to be set on the specific formtype. butBut thats sonata, were can iI find the form iI have to work on?

im stuck with following error message on a project with symfony 2.8 and sonata admin/media bundle. i log in sonata and navigate to the list view were i have an edit button. i click the edit button and get following error.

error message: The form's view data is expected to be of type scalar, array or an instance of \ArrayAccess, but is an instance of class DateTime. You can avoid this error by setting the "data_class" option to "DateTime" or by adding a view transformer that transforms an instance of class DateTime to scalar, array or an instance of \ArrayAccess.

i found some answers via stackoverflow saying that the data_class needs to be set on the specific formtype. but thats sonata, were can i find the form i have to work on?

I'm stuck with following error message on a project with symfony 2.8 and sonata admin/media bundle. I log in sonata and navigate to the list view were I have an edit button. I click the edit button and get following error.

error message: The form's view data is expected to be of type scalar, array or an instance of \ArrayAccess, but is an instance of class DateTime. You can avoid this error by setting the "data_class" option to "DateTime" or by adding a view transformer that transforms an instance of class DateTime to scalar, array or an instance of \ArrayAccess.

I found some answers via stackoverflow saying that the data_class needs to be set on the specific formtype. But thats sonata, were can I find the form I have to work on?

Source Link
netzding
  • 777
  • 4
  • 23

how to set sonata form data_class on edit

im stuck with following error message on a project with symfony 2.8 and sonata admin/media bundle. i log in sonata and navigate to the list view were i have an edit button. i click the edit button and get following error.

error message: The form's view data is expected to be of type scalar, array or an instance of \ArrayAccess, but is an instance of class DateTime. You can avoid this error by setting the "data_class" option to "DateTime" or by adding a view transformer that transforms an instance of class DateTime to scalar, array or an instance of \ArrayAccess.

i found some answers via stackoverflow saying that the data_class needs to be set on the specific formtype. but thats sonata, were can i find the form i have to work on?