plentymarkets / plentymarkets-shopware-connector

plentymarkets shopware connector plugin
http://www.plentymarkets.eu/shopware/
MIT License
30 stars 51 forks source link

Cannot create Images for empty filenames ("/.jpg") #431

Closed florianliebig closed 5 years ago

florianliebig commented 5 years ago
Q A
issue or Enhancement issue
Version Specific version or SHA of a commit

Actual Behavior

In our plentymarkets there are some files just named ".jpg" without any letters before. Theses files can't be imported:

PHP Warning: fopen(/tmp/tJqJBg/): failed to open stream: Is a directory in /XXX/vendor/shopware/shopware/engine/Shopware/Components/Api/Resource/Media.php on line 310 Command failed: TransferObjectCommand {"adapterName":"ShopwareAdapter","objectType":"Media","commandType":"handle","priority":30,"payload":"XXX","exception":"[object] (Exception(code: 0): Could not load image https://cdn02.plentymarkets.com/###/item/images/XXXX/full/.jpg at /XXX/vendor/shopware/shopware/engine/Shopware/Components/Api/Resource/Media.php:470)"}

There are files named with some chars before the .jpg (e.g. "/_1.jpg") but these are also not imported by the connector. These products don't have any image at all

Expected Behavior

All image files should be able to be imported. At least files with some chars before the ".jpg".

Possible Solutions

I tried to fix this by falling back using the MD5 as the filename but this didn't work either: https://github.com/florianliebig/plentymarkets-shopware-connector/commit/fc87541ef427bffa5a40d7cebd602aed76b162d3

Pfabeck commented 5 years ago

Hey, unfortunately I can’t reproduce this behaviour.