Zend certified PHP/Magento developer

Magento 2: Skip some product attribute from mass Update Attributes

I have an issue about mass Update Attributes because I used datetime in product attribute and seem Magento not support it.

ref: https://github.com/magento/magento2/issues/35214

So I tried skip that attribute by override MagentoBackendBlockWidgetForm.php

di.xml:

<preference for="MagentoBackendBlockWidgetForm" type="[Vendor][Module]BlockWidgetForm" />

Change this:

protected function _setFieldset($attributes, $fieldset, $exclude = [])
{
    $this->_addElementTypes($fieldset);
    foreach ($attributes as $attribute) {
        /* @var $attribute MagentoEavModelEntityAttribute */
        if (!$this->_isAttributeVisible($attribute)) {
            continue;
        }
        if (($inputType = $attribute->getFrontend()->getInputType())
            && !in_array($attribute->getAttributeCode(), $exclude)
            && ('media_image' !== $inputType || $attribute->getAttributeCode() == 'image')
        ) {
            $element = $this->creator->create($fieldset, $attribute);
            $element->setAfterElementHtml($this->_getAdditionalElementHtml($element));

            $this->_applyTypeSpecificConfig($inputType, $element, $attribute);
        }
    }
}

To this:

protected function _setFieldset($attributes, $fieldset, $exclude = [])
{
    $this->_addElementTypes($fieldset);
    foreach ($attributes as $attribute) {
        /* @var $attribute MagentoEavModelEntityAttribute */
        if (!$this->_isAttributeVisible($attribute)) {
            continue;
        }
        if (($inputType = $attribute->getFrontend()->getInputType())
            && !in_array($attribute->getAttributeCode(), $exclude)
            && ('media_image' !== $inputType || $attribute->getAttributeCode() == 'image')
            && ('datetime' !== $inputType)
        ) {
            $element = $this->creator->create($fieldset, $attribute);
            $element->setAfterElementHtml($this->_getAdditionalElementHtml($element));

            $this->_applyTypeSpecificConfig($inputType, $element, $attribute);
        }
    }
}

But it isn’t working. It still access in MagentoBackendBlockWidgetForm.php