Skip to content

UPS carrier model getting error when create plugin in to Magento 2.3.3 compatibility #25390

Closed
@Bhavik-kumar

Description

@Bhavik-kumar

Preconditions (*)

Magento 2.3.3 & 2.3-develop
with Developer mode.

Steps to reproduce (*)

  1. create plugin for Magento\Ups\Model\Carrier with custom di.xml
    app/code/<vender>/<module>/etc/di.xml
<type name="Magento\Ups\Model\Carrier">
	<plugin name="fix-for-Ups" type="<vender>\<module>\Plugin\Carrier\Ups" sortOrder="1" />
</type>
  1. create class as below mention
namespace <vender>\<module>\Plugin\Carrier;

class Ups
{
    public function afterCollectRates(\Magento\Ups\Model\Carrier $subject, $result, $request)
    {
       
        return $result;
    }
}

Expected result (*)

Plugin should work properly with developer mode

Actual result (*)

Getting below error

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 Magento\Ups\Model\Carrier::__construct last param should be null (newly added in to 2.3.3) $proxyDeferredFactory is not follow compatibility

Metadata

Metadata

Assignees

Labels

Component: Framework/CodeComponent: ShippingFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentProgress: PR CreatedIndicates that Pull Request has been created to fix issueReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions