I created a complex product attribute entry in product admin, which uses dynamic rows.

Same idea as this core one:

enter image description here

UI works fine, but if you remove all rows, and save, the attribute does not update, and reloads back to the rows prior to removed. So, basically, you cannot clear out the rows/entries.

However, this example core one works 100%.

My entry is adjusted using UI Components modifiers, exactly like this core attribute is done.


(they used a derived UI component called Magento_Catalog/js/components/dynamic-rows-tier-price in place of Magento_Catalog/js/components/dynamic-rows, but they are essentially the same. Tested as well by making my component use the same, which did not solve the issue (just in case)

So, essentially, we have ability to build these complex input components, but they cannot be cleared.


1 Answer 1


I am placing this answer, to allow someone having same issue get help.

Investigating how magento core solves this issue (thinking I am missing something in my UI Component setup), I found this line of code:


$productData['tier_price'] = isset($productData['tier_price']) ? $productData['tier_price'] : [];

So, seems like this issue is solved (by core) as part of the product data initialisation

Essentially, the issue is that since the attribute contains no data, at saving, it is not in the POST data, so is not handled.

That line of code solves this.

The solution I did was to place a before interceptor to the initializeFromData method, and handle my own attribute the same.

Personally, I think this stinks. The UI component system should have a way to deal with this, and not need to place such code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.