magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.48k stars 9.29k forks source link

Product Images loosing inheritance scoping in multisite after storeview rest API PUT #35512

Closed eraq closed 2 years ago

eraq commented 2 years ago

Preconditions and environment

Magento 2.4.4, multisite with more than one store view. Occurs in cloud docker, as well as staging and product cloud environments.

Steps to reproduce

  1. have or create a product with a product image (image, thumbnail, small_image) assigned to default scope value
  2. use the storeview scoped products PUT rest api to update a single attribute such as 'name' on that sub storeview (e.g {{domain}}/rest/{{store_view_code}}/V1/products/{{sku}}).

Expected result

name attribute is updated creating a single row with store_id=1 in catalog_product_entity_varchar. No other rows with store_id != 0 are created in catalog_product_entity_varchar, and no rows are created in catalog_product_entity_media_gallery_value

Actual result

attribute row of store_id=1 for name attribute is created successfully, but several rows of store_id=1 are created for attributes 'image', 'thumbnail', and 'small_image' which then breaks inheritance of the image from default level. Also a store_id=1 row is created in catalog_product_entity_media_gallery_value.

Additional information

No response

Release note

No response

Triage and priority

m2-assistant[bot] commented 2 years ago

Hi @eraq. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] commented 2 years ago

Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-November commented 2 years ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 2 years ago

Hi @engcom-November. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 2 years ago

Hi @engcom-November, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

engcom-November commented 2 years ago

Hi @eraq , Thank you for reporting and collaboration. Verified the issue on Magento 2.4-develop branch but cannot able to reproduce the issue. Steps performed:

  1. Magento multi store setup
  2. Created a product without image and assigned product to both websites
  3. Change scope to default store view scope and added image with options "Small" and ""Thumbnail - Save
  4. Verified DB tables: catalog_product_entity_varchar and - 13 records got created catalog_product_entity_media_gallery_value - 2 records created for store id's 0 and 1
  5. Send PUT request using below payload for default store view scope: http://mg24ce.local/rest/default/V1/products/simple234 { "product": { "sku": "simple234", "name": "efefefefe" } } image No new row/records created in catalog_product_entity_media_gallery_value table and only one new row created with store id 1 in catalog_product_entity_varchar for product name image image Kindly recheck the issue again on magento 2.4-develop branch and provide missing steps if any if the issue is still reproducible. Thank you.
engcom-November commented 2 years ago

Hi @eraq , We are closing this issue as there has been no latest update on the same. Kindly reopen/ create new issue if you are still facing issues. Thank you.