Type
magento2-module
Magento2 Extension for enabling extensions to support multiple Magento2 versions at once
magento2-module
None
None
None
None
None
None
The target of this 'extension' is to provide forward/backward compatibility ports of functionality within Magento2. This is aimed at extension developers to allow them to only have to maintain one development branch of their extension, that can be compatible with all Magento versions.
Magento 2.3 introduced the CsrfAwareActionInterface which allows controllers to receive POST requests from outside of the shop (e.g. for postsale activities of payment service providers). To retain functionality the extension provider would have to maintain two development branches of their extension, one for Magento 2.3 with the interface, and one without.
To avoid this, this extension provides an abstract controller that can be extended by controllers within third party extensions that need this functionality (implementing the CsrfAwareInterface). They will have to implement some abstract methods, however they can use one development branch for their extension.
This extension has multiple versions:
To use the features of this extension add an requirement in your extensions composer.json:
{
"require": {
"netresearch/module-compatibility-m2": "*"
}
}
Yes we recommend *
, if you don't care or e.g. >=2.0.0
if you want to support Magento 2.2.*.
This extension will itself require the affected Magento components (e.g. magento/framework
) in the related versions,
which will only allow a specific version of this extension on the merchants installation through composer.
Magento\Framework\App\CsrfAwareActionInterface
)Compatibility breaking version: Magento 2.3.0
To have a backward compatible controller for Magento 2.3 that can accept external POST requests, just extend {{Netresearch\Compatibility\Controller\CsrfAware\Action}} and implement the abstract methods. For Magento 2.2 and 2.1 that will likely result in dead code (unless you refer to those functions in the rest of you Controller), but you don't have to worry about managing the Interface implementation yourself.
Open Software License v. 3.0 (OSL-3.0)
Netresearch DTT GmbH (www.netresearch.de)