ÃÛ¶¹ÊÓÆµ

[PaaS only]{class="badge informative" title="Applies to ÃÛ¶¹ÊÓÆµ Commerce on Cloud projects (ÃÛ¶¹ÊÓÆµ-managed PaaS infrastructure) and on-premises projects only."}

ACP2E-3789: Media files duplicated on product update via WebAPI

The ACP2E-3789 patch fixes the issue where product updates via WebAPI duplicate media files when a media ID is provided. This patch is available when the Quality Patches Tool (QPT) 1.1.66 is installed. The patch ID is ACP2E-3789. Please note that this issue is scheduled to be fixed in ÃÛ¶¹ÊÓÆµ Commerce 2.4.9.

Affected products and versions

The patch is created for ÃÛ¶¹ÊÓÆµ Commerce version:

  • ÃÛ¶¹ÊÓÆµ Commerce (all deployment methods) 2.4.7-p3

Compatible with ÃÛ¶¹ÊÓÆµ Commerce versions:

  • ÃÛ¶¹ÊÓÆµ Commerce (all deployment methods) 2.4.5 - 2.4.8
NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your ÃÛ¶¹ÊÓÆµ Commerce version, update the magento/quality-patches package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.

Issue

Updating a product via WebAPI with a media ID causes the system to duplicate media files instead of replacing them, creating new files with each API call and resulting in a buildup of images that overloads the /pub/media/catalog/products/cache/ directory.

Steps to reproduce:

  1. Create a product and add an image.
  2. Get product details using the REST API at base_url/rest/V1/products/<sku>.
  3. Perform a PUT request to update the product, keeping the media_gallery_entries unchanged (same image name and file).
  4. Check the pub/media/catalog/product/xx/yy directory before and after the update.

Expected results:

The image file is replaced when the media ID is included in the request.

Actual results:

The image is duplicated with a new name (for example, wb04-blue-1.jpg), causing unnecessary file buildup.

Apply the patch

To apply individual patches, use the following links depending on your deployment method:

To learn more about Quality Patches Tool, refer to:

recommendation-more-help
c2d96e17-5179-455c-ad3a-e1697bb4e8c3