Closed
Description
Preconditions
- Magento 2.1.2 or Magento 2.2.0-dev.
- Use the PHP api rather than the json one.
Steps to reproduce
- A product already exists in Magento, that has images (of any type) on it.
- Update the images on the product through the API and save it.
Expected result
- On updating a product through the php API, any existing images should remain on the product and new ones updated.
Actual result
- The images (whether new or existing) are removed from the product in the UI.
Note: On product update, the value of the store id on table 'catalog_product_entity_media_gallery_value' is set to 1 (when previously it was set to 0). I believe this prevents the update being done to the catalog_product_entity_varchar table for the asset.
I have got round this issue by inserting a row to the varchar table for each asset type after a product save. The assets still exist on the media gallery tables, but are removed from the product varchar table, which prevents them from being displayed in the UI.