Embed a Collection of Forms Error: Could not determine access type for property

后端 未结 8 1304
悲哀的现实
悲哀的现实 2021-02-18 22:34

I am trying to embed collection of Tag forms to Service form, according to this tutorial. Tag and Service entities have many-

8条回答
  •  感动是毒
    2021-02-18 23:14

    Maybe the problem is that Symfony can't access that property?

    If you look at where that exception is thrown (writeProperty method in the PropertyAccessor class) it says it can be thrown:

    If the property does not exist or is not public.

    In the tutorial you mentioned it has property $tags, and method addTag. I'm just guessing here, but maybe there's a convention where it tries to call a method names add($singularForm) and this is failing for you because the property is tagList and the method is addTag.

    I'm not 100% sure, but you could try debugging by setting a stop point in that Symfony method to see why it's being thrown.

提交回复
热议问题