I'm trying to change the behavior of a Modal (not Model) in Magento 2.
The modal in question is advanced_inventory_modal, declared in module-catalog-inventory/view/adminhtml/ui_component/product_form.xml.

Now I know I can use a Modifier in the product-form-modifier-pool:

<virtualType name="Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Pool">
        <argument name="modifiers" xsi:type="array">
            <item name="hf_quantity" xsi:type="array">
                <item name="class" xsi:type="string">Vendor\Module\Ui\DataProvider\Product\Form\Modifier\Quantity</item>
                <item name="sortOrder" xsi:type="number">100</item>

... and use the modifyMeta()-method in my modifier to manipulate the XML configuration, but for some reason, the inventory modal is not present in the data that is provided here. It's also not a sortOrder-related problem since I already set that way high. The sortOrder-attribute might have something to do with it.

So what gives? Can anyone tell me what's the proper way to modify the content of an existing modal in Magento 2?


I found a solution or workaround (not sure yet) on how to achieve what I am trying to achieve. It turns out that if I set sortOrder to 10000 I have some data in my modifyMeta()-a method that I can use:

public function modifyMeta(array $meta)
    if ($path = $this->arrayManager->findPath('quantity_and_stock_status_qty', $meta, null, 'children')) {
            $path . '/children/qty/arguments/data/config/validation/validate-digits',

    if ($path = $this->arrayManager->findPath('advanced_inventory_modal', $meta)) {
        $meta = $this->arrayManager->merge(
            $path . '/children/stock_data/children/qty/arguments/data/config',
            ['validation' => ['validate-digits' => false]]

    return $meta;

Note that the `advanced_inventory_modal` node is not yet complete, but my best guess is that the later addition of the modal merges with these settings, but doesn't override it. Could be wrong though, perhaps someone could share some more light on how this mechanism works?
  • 1
    That's the only way so far to customise kind of Ui component like this. The PHP modifiers. Commented Jul 18, 2017 at 4:24
  • 2
    @Giel Berkers Your question is good but unfortunately I don't know how to answer it. Fortunately I have enough reputations to place bounty on your question to attract someone who knows to answer your question. My kind. Commented Sep 4, 2017 at 22:34

2 Answers 2


There are two ways:
1. Create a new model(through new module creation in the local pool)
2. To override the existing model of the specific module which you want.


You can set <sequence> in module.xml of CatalogInventory module. After that, you can create product_form.xml under


With the same path as it is in the CatalogInventory. This will replace the configuration you needed.

I would like to provide any examples but I don't know what you need here. P.S. you don't need to add other elements you don't need in your XML. they will be taken from parent xml configuration.

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.