VichUploaderBundle
VichUploaderBundle copied to clipboard
The relative path is not saved when I upload an image
Bug Report
Q | A |
---|---|
BC Break | yes |
Bundle version | 1.15 |
Symfony version | 4.4 |
PHP version | 7.4 |
Summary
It's no saving the relative path in the db, => platformsh +-----+-----------+----------------------------+--------+---------------------+ | id | image_url | image_name | text | updated_at | +-----+-----------+----------------------------+--------+---------------------+ | 706 | NULL | 60393424606c4224094292.png | 212121 | 2021-02-26 17:47:16 | +-----+-----------+----------------------------+--------+---------------------+
Current behavior
it's not saving the relative path, it's NULL, I followed the steps described in the documentation, in fact on my laptop it works perfectly, but on the linux server of platformsh it does not have the same behavior, do you have any idea about it?
If I create a listener App\EventListener\UploadableImageListener: tags: - { name: doctrine.event_listener, event: prePersist } - { name: doctrine.event_listener, event: preUpdate } - { name: kernel.event_listener, event: vich_uploader.post_upload}
and set some logs, then I can see on Linux: prePersist run before onVichuploaderPostupload event [2021-02-26 16:09:50] app.INFO: ==> prePersist [] [] [2021-02-26 16:09:50] app.INFO: ==> onVichuploaderPostupload [] []
and in my laptop [2021-02-26 16:02:18] app.INFO: ==> onVichuploaderPostupload [] [] [2021-02-26 16:02:18] app.INFO: ==> prePersist [] []
How to reproduce
I'm using easy-admin, so we just need going to the correct view and add the image, but it's not saving the relative path
Expected behavior
it should save the relative path
If you're not able to reproduce the problem even on your machine, I guess it's impossible to help you
For temporarily workaround, i think you can just insert the image_url by your own?
Closing for missing feedback