spatie / statamic-responsive-images

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

Return empty string when image is not found #242

Open kevinmeijer97 opened 2 months ago

kevinmeijer97 commented 2 months ago

Statamic pages result in a 404 when an image is not found. Returning an empty string here avoids this issue.

ncla commented 2 months ago

Does this fix issue #241?

ncla commented 2 months ago

Hmm I see it is similar, but not exact one. Seems like Glide exception handling has changed since last time I worked with Statamic.

ncla commented 2 months ago

I can't reproduce the 404. I changed asset field value to a non existing file, but the responsive tag just rendered nothing - which is to be expected. Can you please provide reproduction steps?

kevinmeijer97 commented 1 month ago

What made it breaking for us was as followed: We had a testing and production environment, we pulled the production DB to the testing environment but didn't sync the assets. This made it so that there was an image set on an image field, during render it would search for this asset but couldn't find it since we hadn't synced the assets. After this it would throw the 404 on our missing asset and our page as a whole. I was able to reproduce this on multiple sites that we maintain by doing the steps above.