VichUploaderBundle
VichUploaderBundle copied to clipboard
form field is broken when using flysytem and liip_imagine
hello,
using vich_uploader in conjunction with liip_imagine and flysystem (s3), I'm having trouble to use uri_prefix :
- if I write a full URL (http://...), then the form works correctly, but liip_imagine is broken (il include the http:// in the cache path and it broke)
- if I write an url relative to the flysystem mounted fs, liip_imagine works correclty, but the form element
VichImageType::classis broken (the preview is relative to the web root instead of pointing to s3)
so basically, we can have either the form field working or liip_magine, not both.
@bruno-ds have you idea how it could be solved? Maybe open PR. Interesting issue, I think that many people can got it.
I propose this kind of change :
- Add an
uri_prefix_alt(the name is purposely ugly because I can't find out a great one) - add a third optional parameter to the helpers (ie for twig helper
vich_uploader_asset). This parameter activing the use of the alt prefix.
Going this way is not the smartest, but I think that it's the laziest since it creates the less risk.
Alternative implementation would need also two parameter but instead of swapping, it would concatenate them accordingly to new parameters.
Does your liipimagine data loaders configuration are in sync with vichuploader storage configuration? Have you tryed http://symfony.com/doc/master/bundles/LiipImagineBundle/data-loader/flysystem.html or http://symfony.com/doc/master/bundles/LiipImagineBundle/data-loader/stream.html ? Or https://symfony.com/doc/current/bundles/LiipImagineBundle/cache-resolver/aws_s3.html
Hello, I use the first one : http://symfony.com/doc/master/bundles/LiipImagineBundle/data-loader/flysystem.html but unless it still have to be given the path to the file, in order to work, unless I misunderstood something (it is strongly possible ^^), this path must be "absolute", without the protocol and the host.