In Magento 2.2 the multiple product image up-loader block has been moved from layout to UI component form. To make it compatible with Magento-2.2 I made the required changes in my custom module and it worked for me. But, when I reinstalled the module on (Magento 2.1.8), it does not recognize the block and settings nodes, I got the following errors. Is it not backward compatible? What if we wish to run the same module on both Magento 2.2 and 2.1? Are there any module settings where we can change the format for different versions? How can we place a check or condition because in both version the block is placed at two different locations? How to get rid of these errors, any help would be appreciated.
The requested component ("settings") is not found. Before using, you must add the implementation.
The requested component ("block") is not found. Before using, you must add the implementation.
Here is my UI Form
<htmlContent name="gallery" sortOrder="22">
<argument name="data" xsi:type="array">
<item name="wrapper" xsi:type="array">
<item name="label" xsi:type="string" translate="true">Gallery Images</item>
<item name="collapsible" xsi:type="boolean">true</item>
<item name="opened" xsi:type="boolean">false</item>
</item>
</argument>
<settings>
<wrapper>
<canShow>true</canShow>
<componentType>fieldset</componentType>
</wrapper>
</settings>
<block name="gallery" class="Vendor\Module\Block\Adminhtml\Media\Helper\Form\Gallery">
<block class="Vendor\Module\Block\Adminhtml\Media\Helper\Form\Gallery\Image" as="content">
<arguments>
<argument name="config" xsi:type="array">
<item name="parentComponent" xsi:type="string">events_event_form.events_event_form.block_gallery.block_gallery</item>
</argument>
</arguments>
</block>
</block>
</htmlContent>