-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
REST products update category_ids cannot be removed (from #20481) #25646
Comments
Hi @siliconalchemy. Thank you for your report.
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:
For more details, please, review the Magento Contributor Assistant documentation. @siliconalchemy do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
My workaround is to edit vendor/magento/module-catalog/Model/Category/Link/SaveHandler.php and change: Deleting categories then works perfectly for me, but I don't know what other impacts that could have. |
Hi @engcom-Charlie. Thank you for working on this issue.
|
Hello @siliconalchemy Thank you for contribution and collaboration! We are not able to reproduce this issue on the latest 2.3-develop branch by provided steps. Testing scenario: Result: We are closing this issue due to branch
See Accepted pull requests and ported code for more details If you still faced this issue on Thanks for your report! |
Huh, yes I still have this issue in 2.3.3. |
@siliconalchemy i can't confirm issue of it only for 2.3.3( because 2.3.3 codebase has been merged in 2.3-develop) you can see info about it here: |
As long as this is not fixed in Magento you can take this approach: https://stackoverflow.com/questions/68622618/magento-2-rest-api-cant-remove-category-ids/68623022#answer-68623022 |
** Note: This is a continuation of #20481, which in turn is a continuation of #14038. Both of these issues were closed without a correct fix in place **
Preconditions and Steps to Reproduce
For example, if a product currently has custom_attribute { 'category_ids': '['10127', '10048', '10123', '10126'] }, and I want to remove two of the categories from the product by setting this to { 'category_ids': '['10127', '10048'] }.
I then update the product with /rest/all/V1/products/ with the updated data. I get a success returned, and any other product data is successfully updated, and categories can be added to, but trying to remove categories such as above fail silently. The category_ids remain with the original 4 categories, as in the example above.
Magento 2.2.3
Php 7.1, Mysql 5.7 (Percona Xtradb Cluster)
Expected Result
I expect to be able to remove categories. This worked until 2.2 upgrade.
Actual result
See description. Categories are not updated, but the update command reports success.
The text was updated successfully, but these errors were encountered: