Open Servialux opened 6 months ago
Hello everyone,
Well, I'm still trying to figure out where the problem is coming from and I'm trying to fix it. It seems that the problem comes from BaseListener to the function getUploadableFields it is not triggered. On my other projects it is. I don't know if I'm on the right track.
Hello everyone.
I have found a temporary solution. But I don't like it too much.
I just added:
/**
* @var string|File|null
*/
#[ORM\Column(length: 255, nullable: true)]
#[Groups(['get:shop', 'is:file'])]
#[Vich\UploadableField(mapping: 'shopImage', fileNameProperty: 'imageName', size: 'imageSize')]
private $imageFile = null;
It's not a problem, but I'd really like to understand why Vich no longer does this automatically. It doesn't trigger getUploadbleFields.
I'll wait for an answer if someone encounters the same problem.
Have a nice day
@Servialux does the solution mentioned here work for you?
Hi,
I haven't seen the answer. For the moment it work with the annotation I can test it next week. And I tell here if it works
Thanks for your answer
I've looked everywhere but unfortunately I can't find my answer. I tried to debug it myself but without success.
I can write correctly in the db and in my ObjectStorage
I've done the classical way (not my first time) to get FlySystem and VichUploader working. I've come to notice that when I request reading entity, VichUploader is not called at all. As a result, I get the following error:
{"message": "Cannot assign string to property App\Entity\Shops::$imageFile of type ?Symfony\Component\HttpFoundation\\File"}
Thank you in advance for an indication or look I attach my files below.
Best regards, Nestate
Support Question
My vich_uploader configuration file:
And in a controller as i do:
I got the error I've written on top of my message like the bundle is not used for getting from DB I've used them in two projects before this one and I don't understand why this time it doesn't work