Skip to content

/V1/products/{sku}/media does not assign roles correctly #21736

@giacmir

Description

@giacmir

When uploading media gallery images via API the last inserted one gets all roles (small_image, base, thumbnail) even if not required to and another image already has them assigned.

Preconditions (*)

  1. Magento 2.3.0
  2. php 7.1

Steps to reproduce (*)

  1. create a new product without images
  2. POST to /V1/products/{sku}/media a payload that includes all the three image types "base", "small_image", "thumbnail"
    3.Verify in backend that the new image has all three roles
  3. POST another image to /V1/products/{sku}/media, this time the "types" node should be an empty array

Expected result (*)

  1. The last inserted image should have no roles
    2.The first image should have maintained its assigned roles

Actual result (*)

  1. last image has all three roles even if no one was specified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: CatalogEvent: dmcdindia1Issue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: doneReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseSeverity: S2Major restrictions or short-term circumventions are required until a fix is available.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions