VichUploaderBundle icon indicating copy to clipboard operation
VichUploaderBundle copied to clipboard

form field is broken when using flysytem and liip_imagine

Open bruno-ds opened this issue 8 years ago • 4 comments

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::class is 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 avatar Jul 05 '17 13:07 bruno-ds

@bruno-ds have you idea how it could be solved? Maybe open PR. Interesting issue, I think that many people can got it.

Koc avatar Jul 07 '17 13:07 Koc

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.

bruno-ds avatar Jul 09 '17 12:07 bruno-ds

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

Koc avatar Jul 09 '17 13:07 Koc

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.

bruno-ds avatar Jul 10 '17 14:07 bruno-ds