-
Notifications
You must be signed in to change notification settings - Fork 9.4k
REST API: Cannot delete custom attribute from product #10807
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
Comments
According to https://magento.stackexchange.com/a/179153 |
It's passing this: Here's the complete json:
|
That stackexchange link btw is the only one I came across with any answer, and looking at the code I think they might have been confused, the code clearly rejects null values to a key/value pair. There are lots and lots of other similar questions with no answers, however, so I suspect this is a real problem. |
I can confirm null is not working for me either. I am trying to remove an attribute. I have passed null, a blank array, an array with a value 0, an array with Null. None of them worked. When I pass null I get this: error. message Conflict is the attribute name The other ones get a success message but nothing is changed. Edit: Like siliconalchemy that stackexchange is the only answer but that does not seem to be the correct answer. |
So I did something that seems to work for now -- I set the value for of 1 which is a value of another attribute and it set the attribute to null. This fixed the issue for now and I do not see any errors on the product or and the catalog/search page. I would not recommend this solution but if it is pressing this is at least a hotfix. |
I will take care of it |
Hi @cieslix, can you accept invitation from github, so we can assign it on you? |
@maksek yes sure, sorry for delay. |
already fixed in 9e3ca7b |
@cieslix Hi, When you say 'this feature is working as intended', do you mean before your fix? Can you explain how we can delete attributes from products in the current release? |
@cieslix thanks for your finding! However, although this issue was fixed in #9314 for Also, the test is missing for this fix. It should be at least unit test, ideally - unit + WebAPI test. @siliconalchemy fix not released in |
Yet another bug fixed half a year ago that hasn't made it into the stable tree. This project really needs to address the braindead policy of only ever making fixes into the dev branch until enough people complain about an issue. This is an enterprise product, companies commit to a branch for a long time for lots of good reasons. Fixing bugs in point releases is a good thing, people. |
@siliconalchemy this is already changed: no |
Confirmed this fix works when backported into 2.1.9. The path is different - vendor/magento/framework/Webapi/ServiceInputProcessor.php. @orlangur Encouraging that process is improving. I still don't understand why 2.1.x issues are fixed in dev and closed. If it's a 2.1.x. issue and the fix isn't breaking, why isn't it applied to 2.1.x branch and released in the next point release? |
Well, it's because you have Composer-based installation. It can be rewritten with next composer update. A proper way it to rewrite this class in your custom module.
Have no idea, was always wondering this as well. As such process is already obsoleted we probably will never know the truth. Maybe |
OK, so how do we get this into the next 2.1.x release? |
According to my understanding @cieslix is going to work on backport. See https://community.magento.com/t5/Magento-DevBlog/Pull-Requests-for-2-1-x-Patch-Releases/ba-p/65630 for more details. |
@siliconalchemy , thank you for your report. |
Why is this closed? It's not fixed in the current product codebase. It might be months or years before large sites migrate everything to (currently still in development ) 2.2. |
@siliconalchemy it's because Magento 2.2.0 is pretty close to release. This is not an impediment for @cieslix or anyone else to work on backport to |
But 2.2 isn't released. And even when it is, the sheer magnitude of change involved means companies will be running 2.1 for a long time, until 2.2 is stable, bugfixed and all 3rd party extensions supported. |
@siliconalchemy there is no difference if the issue is closed or not as it is managed using dashboard https://github.com/magento/magento2/projects/13#card-4672681. |
That's not completely true.
So that's why it felt like a "beta" version. |
@korostii people will get used to |
Yes, I agree. So? The open\closed state is even more visible and it's always present. |
Let repository owners decide how issue states and labels shall be used 😉 Improvement suggestions are always welcomed in Community Forums, according to my understanding it includes processes improvement suggestions as well. |
Veeeery funny. I see your point but I have not attempted any actions to force any policy on others apart from underlining the deficiencies of current issue flow. My points will remain valid as long as the flow is imperfect. |
When 'people' are running a proven stable 2.2, we'll be overjoyed to see a 'Fixed in 2.2.x' label. As we're not running 2.2, and a lot of these important issues were fixed in months and months before 2.2 was released, forgive us if we're slightly bemused by this workflow which to a lot of people is completely braindead. I've literally lost count of the number of issues that I've come across in 2.1 (the stable branch used by 99% of users) that I've eventually found long fixed in 2.2. |
This is nothing more than your subjective opinion.
That's exactly why default branch is now
Surely, no objections. Let's just use proper communication channels for each separate activity, like Slack or something. Useful thoughts rotting in random GitHub issue is no better than raising them in Community Forums. Thanks all for your valuable inputs! |
Cannot delete an existing product custom attribute through the rest API.
Preconditions
Steps to reproduce
Expected result
Actual result
If key/value is removed from the custom_attributes, then the Put call goes through without error, but the key/value is still present within custom_attributes, unaltered.
All other values update using exactly the same mechanism/code without issue, can add/change custom attributes correctly. Just cannot delete the custom attributes.
The text was updated successfully, but these errors were encountered: