magento2-prismicio icon indicating copy to clipboard operation
magento2-prismicio copied to clipboard

Layout handle `<action .../>` is deprecated

Open JeroenBoersma opened this issue 1 year ago • 0 comments

In the future the action handle will be removed from Magento, we rely on it to set references. We should implement an alternative and make it easier to set the reference via <arguments .../> on the block directly.

From the Magento docs: https://developer.adobe.com/commerce/frontend-core/guide/layouts/xml-instructions/#action

Currently we use <action method="setReference" /> to set the reference...

This change would involve adding reference as an argument in the constructor so we can use

<block ...>
    <arguments>
        <argument name="reference" xsi:type="string">reference</argument>
    </arguments>
</block>

instead of

<block ...>
    <arguments>
        <argument name="data" xsi:type="array">
            <item name="reference" xsi:type="string">reference</item>
        </argument>
    </arguments>
</block>

JeroenBoersma avatar Mar 01 '23 13:03 JeroenBoersma