3

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>
0

I don't think there is something to "fix" here from core perspective.

Sometimes it is possible to make module compatible with many Magento version at the same time, sometimes it is not worth efforts.

Please check http://devdocs.magento.com/guides/v2.0/extension-dev-guide/versioning/dependencies.html and specify constraints of your module properly so that you get a compatible module version for both 2.1 and 2.2.

https://github.com/magento/magento2/issues/12168

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.