Summary
If you create a field with the "image" type, validation "required" or "required-file" doesn't work.
Preconditions
- Magento 2.2.5 CE with sample data
- PHP 7.0.30
Steps to reproduce
- Create any custom module.
- Create system.xml configuration and add a field with image type for example:
<field id="custom" translate="label" type="image" sortOrder="40" showInDefault="1" showInStore="1" showInWebsite="1" >
<label>Custom Label</label>
<backend_model>Magento\Theme\Model\Design\Backend\Image</backend_model>
<base_url type="media" scope_info="1">vendor_module/label/custom</base_url>
<upload_dir config="system/filesystem/media" scope_info="1">vendor_module/label/custom</upload_dir>
<validate>required required-file</validate>
</field>
- Go to admin side configuration -> do not upload an image in this field -> save configuration.
Expected result
- The require validation error appears.
Actual result
- Configuration is saved without require validation.