after migration my site, i found one strenge issue that when i saved product it not save,
after debbugging i found that
product has custom option of type file
and Compatible File Extensions is required filed,
how to set it to not required
after migration my site, i found one strenge issue that when i saved product it not save,
after debbugging i found that
product has custom option of type file
and Compatible File Extensions is required filed,
how to set it to not required
You want to change only in Magento version 2.2 or greater.
Create etc/adminhtml/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\CustomOptions" type="vendor\module\Ui\DataProvider\Product\Form\Modifier\CustomOptions" />
</config>
Please overwrite CustomOptions.php in your vendor/module/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php
And find getFileExtensionFieldConfig
function. remove this the code from that function,
'validation' => [
'required-entry' => true,
],
After execute php bin/magento cache:clean
and check your admin panel.
I hope this will help you.