magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.5k stars 9.3k forks source link

Wrong object passed to collectRates method in collectRatesByAddress method in Shipping model #7309

Closed pierzakp closed 7 years ago

pierzakp commented 7 years ago

Preconditions

  1. Magento CE 2.1.1.

Steps to reproduce

  1. In your custom code call method collectRatesByAddress which is implemented in \Magento\Shipping\Model\Shipping.

Expected result

  1. Expected behavior is to not have fatal error for sure. Be able to get result of collect rates.

Actual result

  1. Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Shipping\Model\Shipping::collectRates() must be an instance of Magento\Quote\Model\Quote\Address\RateRequest, instance of Magento\Shipping\Model\Shipment\Request given
  2. In collectRatesByAddress method at the beginning comment which is placed there suggests that factory will create \Magento\Quote\Model\Quote\Address\RateRequest object, which is correct because collectRates method expects this type, but \Magento\Shipping\Model\Shipment\Request is created instead.
joni-jones commented 7 years ago

Hi @pierzakp, thanks for reporting. The internal ticket is created (MAGETWO-62662).

alena-marchenko commented 7 years ago

Hi @pierzakp

Fix for MAGETWO-62662 is merged to develop branch, closing the issue. Thank you.

Ctucker9233 commented 7 years ago

@alena-marchenko Which version of Magento will have MAGETWO-62662 included?

rmilea commented 7 years ago

@alena-marchenko Can you please let us know the Magento version that will contain the fix for MAGETO-62662.

I'm using version 2.1.7 and is not fixed yet.

joni-jones commented 7 years ago

@rmilea this issue fixed in 2.2.0 release.

rmilea commented 7 years ago

@joni-jones Is there a patch available for 2.1.7 ?

joni-jones commented 7 years ago

No, the fix didn't backport to 2.1.x.

Ctucker9233 commented 6 years ago

@joni-jones Will it be backported or does it break BC?