Open ndoulgeridis opened 9 years ago
Hi @crash21
This has been introduce because of some changes to the Vich assets API. Before this changement, Vich was expecting a file object (or a feld, I don't remember). But since some new versions, Vich is waiting for the mapping name. But this is just for the Assets twig function. It should not change anything in your persistence layer (Doctrine).
Do you have a use case of error?
It's happening when vich mapping name is different from file field name Then in this line I wrote above changes the field name with vich mapping name and then throws Doctrine error as the mapping name cant be mapped to the Entity because it doens't exists of course.
In example above $param 1 has the value "file" After line 64 have the value "gallery_image" and gallery_image is not a field of the Entity but just vich mapping name. Then Doctrine throws exception because tries to map gallery_image to Entity.
In my case, commenting line 64 solves the error but dunno how this will affect other use cases.
What is the version of your Vich library please?
I use
"vich/uploader-bundle": "dev-master"
I think latest dev-master is v0.13.0
OK... I have no working project based on this version of Avocode Bundle. I'll test what you say updating the repository https://github.com/sescandell/CollectionUploadSample
up
You should try locking on v0.13.0
. If I remember correct they introduced some changes, the new repo (FormExtensionBundle) is OK with v0.14.0+ while the legacy repo (AvocodeFormExtensionsBundle) is compatible with v0.13
Hello, @loostro where is the new repo you are talking about? (FormExtensionBundle) The only I find with this name is a repo last updated 2 years ago.
@crash21 it's on our github account symfony2admingenerator/FormExtensionsBundle
Hello,
I have found an issue:
On file: vendor/avocode/form-extensions-bundle/Avocode/FormExtensionsBundle/Twig/Extension/ImageAssetsExtension.php
there is in line 64:
This change the right param 1 (which in my side is file) to the vich_upload mapping name so change it to gallery_image.
This has as a result to get Doctrine mapping error as gallery_image is not a field of course but vich_upload mapping name.
Am I right?