FriendsOfShopware / FroshPlatformBunnycdnMediaStorage

This plugin allows you to use BunnyCDN as a media storage.
MIT License
8 stars 9 forks source link

Broken Images in Shopware 6.5.7.1 after Update #55

Closed ldehne-comcreate closed 11 months ago

ldehne-comcreate commented 11 months ago

PHP Version

8.2

Shopware Version

6.5.7.1

Plugin Version

3.1.0

Actual behaviour

We recently upgraded our Shopware instance to version 6.5.7.1, under the assumption that BunnyCDN would be compatible with this version, as per the information provided here: image

However, post-update, we are experiencing an issue where all our images are no longer displaying correctly, as shown in the screenshot:

image

Upon investigating, we noticed that Shopware's recent update includes changes in how image links are stored (as detailed in the Shopware Upgrade Notes). We suspect this might be the root cause of our issue.

Could you please help us understand if this is a known issue with the BunnyCDN integration? Do we need to re-upload all our images, or is there an alternative fix available? Any guidance on resolving this would be greatly appreciated.

Thank you for your assistance.

Expected behaviour

Showing all Images

Steps to Reproduce?

Update Shopware

tinect commented 11 months ago

if you installed the plugin fresh, you need to upload any existing media on your own just new media will be uploaded automatically.

you might want to check the installation manual linked in the shopware store or the README: https://github.com/FriendsOfShopware/FroshPlatformBunnycdnMediaStorage#usage

tinect commented 11 months ago

just for info: this plugin does not manipulate the path of any media. it just changes the domain based in your setting.

if the path is wrong, you might want to check the env SHOPWARE_CDN_STRATEGY_DEFAULT or config regarding the linked issue to fit the value before your shopware upgrade. should be „id“ in old shops.

https://github.com/shopware/shopware/issues/781

ldehne-comcreate commented 11 months ago

We used the plugin in the past and just updatet the shopware instance all media link changed. the media files are uploaded in bunnycdn in the past.

tinect commented 11 months ago

check this please: https://github.com/FriendsOfShopware/FroshPlatformBunnycdnMediaStorage/issues/55#issuecomment-1821251181

tinect commented 11 months ago

@Lukaloco have you made any progress?

ldehne-comcreate commented 11 months ago

Hello @tinect ,

Thank you very much for your tip! It turned out to be the solution: I added SHOPWARE_CDN_STRATEGY_DEFAULT=id to the .env file, and after the update, all the images were still there. Many thanks for that! I'd love to send you a case of beer to celebrate.

ldehne-comcreate commented 11 months ago

Hello @tinect,

We performed an update today, and after about six hours, we noticed that the images in the backend appear to be corrupted. To illustrate, here's an example: Link to the corrupted image *_400x400.jpg?018c162e1c6c7f0cba201aa4db3e562a

Interestingly, when we remove the GET parameter from the URL, the image loads correctly: Link to the working image *_400x400.jpg

maybee this is Cache Buster?

path-strategies

It is no more necessary to call the path hashing by your own. All cache busting and other logic is done in the abstract implementation. The functions are now seperated and can be reused in your implementation. The path is generated by 4 segments:

Is this issue something we can address through the .env file? Have you encountered a similar problem before? We're quite puzzled and would greatly appreciate any guidance or suggestions. Apologies for any inconvenience.

Thank you for your support.

tinect commented 11 months ago

Hey @Lukaloco,

Currently, I have no idea. The image is saved on the storage of bunnyCDN? I mean, they support any query-string.

You might find support in community slack, but not by adding comments into closed issue.