spatie / statamic-responsive-images

Responsive images for Statamic 3
MIT License
99 stars 29 forks source link

Statamic multisite cached images being referenced incorrectly. #177

Closed mbs-arran-baker closed 1 year ago

mbs-arran-baker commented 1 year ago

Bug description

When statamic multi-site on the fly generated images are referencing locale paths rather than actual paths on localised routes when generated

When Statamic multisite is enabled, images generated using {{ responsive:image }} on locale website localised subdomain referencing incorrect cache path. eg.

domain.com Images reference cache path correctly on '/img/asset/'

**domain.com/fr/ Images reference cache path incorrectly on '/fr/img/asset/'

Explanatory Loom https://www.loom.com/share/f3d0855e8dc84f1293e7b793c5a1fdd7

How to reproduce

sites.php

'sites' => [
        'default' => [
            'name' => 'EN',
            'locale' => 'en',
            'url' => env('APP_URL'),
        ],
        'fr' => [
            'name' => 'FR',
            'locale' => 'fr',
            'url' => env('APP_URL').'/fr'
        ],
    ],

assets.php 'cache' => false,

Logs

No response

Environment

Statamic 3.3.9 Pro
Laravel 9.9.0
PHP 8.1.9
spatie/statamic-responsive-images 2.14.2
withcandour/aardvark-seo 2.0.25

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

runtime (new)

Additional details

No response

ncla commented 1 year ago

Can you test if this issue is happening with just regular glide tag usage? From quick glance I am inclined that this might be a core CMS issue instead.

Additionally your Statamic version is a bit old, the latest version as of writing is 3.3.49. Can you upgrade and test if the issue is still there?

mbs-arran-baker commented 1 year ago

Yes, Statamic is now updated to latest version. I have tested with glide tag and getting the same result.

ncla commented 1 year ago

In that case it should be an issue with core CMS and not this addon, if you are able to replicate this issue with regular glide tag. Contact support or open issue on their repository.