akeneo / pim-community-dev

[Community Development Repository] The open source Product Information Management (PIM)
http://www.akeneo.com
Other
952 stars 514 forks source link

S3 media storage url and product export url mismatch #7659

Open crapougnax opened 6 years ago

crapougnax commented 6 years ago

From Akeneo 2.1, I am storing my products assets on an Amazon S3 bucket and the media are displayed correctly on the GUI.

A typical media looks like this:

https://s3.eu-central-1.amazonaws.com/a6a/catalog/e/4/8/c/e48c9990ed80b07588fb25d0ff33885a95580d44_201702281158239498.jpg

Whenever I export my products to reimport in my Magento2 catalog, the picture URL looks like this:

files/SBR070A/picture/201702281158239498.jpg

Which doesn't seem to match anything real.

The only common part seems to be the name of the original file 201702281158239498.jpg (data was imported) used as a suffix in both URL.

How can I use the exported URL to access/copy the media so I can display it in my Catalog?

Thanks.

crapougnax commented 6 years ago

I have found the culprit file which is src/Pim/Component/Connector/Writer/File/MediaExporterPathGenerator.php

What would be the good course of action?

Write a different media exporter and change my configuration to use it whenever I export ? or patch this file to reflect the fact that the catalog_storage_adapter value is different from the default one?

The former seems a better option but I would appreciate confirmation.