Magento2 – Cannot Save Product Due to Invalid Option Value

magento-2.1.1magento2product

On a specific product I cannot save any changes at all, I always get the error:

Invalid option value

I believe this is down to the custom options and probably this issue:
https://github.com/magento/magento2/issues/4085

I was on 2.1.0rc3 when the error occurred and have since upgraded to 2.1.1

It's not just that I can't save custom options, I can't save any changes at all even to basic fields such as product name.

Maybe the issue is something else, but I can't find any clues in the logs and the error message is not very helpful.

Best Answer

When you have a product with more than 20 values for a custom options Magento adds pagination to this option. See screenshot attached. Below right, pagination. If you want to save this product you have to go through every page of every custom option of that product.

Technical explantion, Magento is using dynamic rows to load this behaviour, if you don't open the second, or third page, the input fields are not added to the HTML. When you save the product those options aren't in the POST values. In the POST Magento is checking if the values are equal but they aren't, because they are not added to the HTML. So the quick fix for now is to go through every page of every custom option and then you can save the product

enter image description here