Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magento 2.3: "Use Default Value" gets unchecked for Multiple Attributes when updating with an API #32544

Closed
5 tasks
elaidomino opened this issue Mar 18, 2021 · 10 comments
Assignees
Labels
Issue: needs update Additional information is require, waiting for response

Comments

@elaidomino
Copy link

Preconditions (*)

  1. Magento 2.3
  2. Multiple Store Views.

Steps to reproduce (*)

  1. Bulk Insert new products on Magento 2 backend and all affected product attributes are checked by default
  2. To connect the Sales to our Warehouse Management System, we need to create the same items to Dearsystems and BULK List the items to create a connection. But, we are using Magento 2 as master source of products. Dearsys only receives data from M2.
  3. After Bulk Listing, go to Magento 2 Default Store View. You'll notice attributes are not checked anymore. Which causes a lot of issues to update all manually.

Expected result (*)

  1. All attributes should remain checked and should FOLLOW the Default value which is checked.

Actual result (*)

  1. Attributes are no longer checked under Default Store View.

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Mar 18, 2021

Hi @elaidomino. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

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

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

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

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

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

@chickenland
Copy link
Contributor

Might help to provide some example API calls and some specific product attributes that are affected

@bernieu2
Copy link

Change your endpoint from /rest/V1/products/:sku (updates single storeId)
to /rest/all/V1/products/{{sku}} (updates storeId = 0)

This seems to be only reference I could find for all store code
https://devdocs.magento.com/guides/v2.3/get-started/gs-web-api-request.html#endpoints

or async endpoint:
PUT /all/async/V1/products/:sku
https://devdocs.magento.com/guides/v2.3/rest/asynchronous-web-endpoints.html#store-scopes

or async bulk endpoint:
PUT /all/async/bulk/V1/products/bySku
https://devdocs.magento.com/guides/v2.3/rest/bulk-endpoints.html#store-scopes

@bartlubbersen
Copy link
Contributor

bartlubbersen commented Apr 13, 2021

I just came across the same issue in a Magento 2.2 shop, not sure how much the code changed in M2.4/2.3 for the consumer part. But as far as I can see looking through the code, there are no changes that could solve this issue between these versions so probably it's the same issue.

After some research I came to the conclusion that for the shop I am working on it's due to the data caching in the ProductRepository class. If you first update the product async so the consumer will have an object in cache. Then keep the consumer running while saving a product through the backend. Then once you make any async changes the consumer will still be using the old product object and it's data. So all data set through the back-end will be reset.

This occurs because the initializeProductData will use removeProductFromLocalCache to clear the cache, but that will only clear the sku array ($instances) and not the product product id array ($instancesById). So while retrieving the product it will fail to do so by sku cache, so it will lookup the id by sku and then still use the id cache.

Hope this helps.

FYI: We have seen similar results with other class caches like orders, stock, customers etc. when using consumers. In multiple projects. So the whole consumers and class caching should be investigated for multiple types.

EDIT: Also it might be important to know that even if instancesById is cleared while removeProductFromLocalCache is being called before all this happens the save action will already retrieve the product earlier and set the product_links and status. So those might still be resetted in that case. So we now clear all the class caches through a beforeSave plugin.

@m2-assistant
Copy link

m2-assistant bot commented Jun 8, 2021

Hi @engcom-Bravo. 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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@m2-assistant
Copy link

m2-assistant bot commented Jun 15, 2021

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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-November engcom-November removed their assignment Jun 29, 2021
@engcom-Delta engcom-Delta self-assigned this Jun 29, 2021
@m2-assistant
Copy link

m2-assistant bot commented Jun 29, 2021

Hi @engcom-Delta. 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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Delta
Copy link
Contributor

Hi @elaidomino,

Thanks for raising the issue , We tried reproducing the issue but need more clarity on steps to reproduce it.

  1. Dearsystems
  2. Kindly specify few attributes which are not checked
  3. it would be great if we get snapshots for reference.

Thanks

@engcom-Delta engcom-Delta added Issue: needs update Additional information is require, waiting for response and removed Issue: ready for confirmation labels Jul 19, 2021
@m2-community-project m2-community-project bot moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Board Jul 19, 2021
@m2-community-project m2-community-project bot moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Board Jul 19, 2021
@hostep
Copy link
Contributor

hostep commented Jul 20, 2021

This sounds like a duplicate of #9186 (and #26484 and #31083 and probably some others), according to the latest comments in those threads the issue might have been fixed by 6a27b0c & 306f515 (both of which are not released yet, so maybe they are coming in Magento 2.4.3?), but it's not really confirmed I think, so I'm not 100% sure.

@elaidomino: if you believe this is not a duplicate of those others, please leave some feedback 🙂

@engcom-Delta
Copy link
Contributor

There has no update from 14 days ,hence closing it.
Kindly raise new ticket if required or re-open existing issue.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: needs update Additional information is require, waiting for response
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants