spacecatninja / craft-imager-x

Image transforms, optimizations and manipulations for your Craft CMS site.
Other
26 stars 16 forks source link

Fix wrong asset url for external volumes #253

Closed WHITE-developer closed 9 months ago

WHITE-developer commented 9 months ago

As in Craft 5 the subpath is moved to the volumes, we should pass the Volume instead of the Filesystem to the generateUrl function

aelvan commented 9 months ago

Thanks! I'm aware that there are several changes regarding volumes and file systems that impact the path handling i Imager, I will dive into this as soon as there's a stable beta out.

aelvan commented 9 months ago

Although the fix looks correct, I'm having a hard time producing any error with the way it was (ie, passing file system). Can you describe how you set things up that resulted in an error? I just want to be able to confirm what this fixes, and root out any other issues related to it. Thanks!

WHITE-developer commented 9 months ago

Hi, Sure this is my filesystem image Where the subfolder is set to '/assets'

And then I have a couple of volumes, each with their own subpath image

I'm using the standard Craft transformer

aelvan commented 9 months ago

I merged this manually into 5.0.0-beta.1 which is out now. Thanks for contributing!

lukas-jansen commented 9 months ago

Looks like they are refactoring the method in next release so that the volume isn't required anymore, https://github.com/craftcms/cms/pull/14353