VichUploaderBundle icon indicating copy to clipboard operation
VichUploaderBundle copied to clipboard

The relative path is not saved when I upload an image

Open jorbope09 opened this issue 3 years ago • 2 comments

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

jorbope09 avatar Feb 26 '21 18:02 jorbope09

If you're not able to reproduce the problem even on your machine, I guess it's impossible to help you

garak avatar Feb 28 '21 17:02 garak

For temporarily workaround, i think you can just insert the image_url by your own?

fd6130 avatar May 16 '21 15:05 fd6130

Closing for missing feedback

garak avatar Feb 07 '23 15:02 garak