Question

Magento 2.3.3 Getting below error when creating plugin for Magento\Ups\Model\Carrier class

1 exception(s): Exception #0 (BadMethodCallException): Missing required argument $data of Magento\Ups\Model\Carrier.

Exception #0 (BadMethodCallException): Missing required argument $data of Magento\Ups\Model\Carrier.

As my understand issue is because of class::__construct last param (newly added in to 2.3.3) $proxyDeferredFactory is not follow compatibility

Magento\Ups\Model\Carrier::__construct (last parameter should be null)

It should be null require

Consider basic knowledge of Plugin!

Welcome suggestion to work with lower MAGENTO version also.

Was it helpful?

Solution

Will be fixed in Magento 2.4. See https://github.com/magento/magento2/commit/cfd5c22848f82f29f69cd42ffbcc8e09fa848568. Workaround: Replace the following line:

?ProxyDeferredFactory $proxyDeferredFactory

with

?ProxyDeferredFactory $proxyDeferredFactory = null

in the constructor arguments

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top