Skip to content

CartTotalRepository cannot handle extension attributes in quote addresses #9646

@ekuusela

Description

@ekuusela

Extension attributes in quote billing or shipping addresses cause Magento\Quote\Model\Cart\CartTotalRepository::get to throw this error:

"PHP message: PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Magento\Quote\Model\Cart\Totals::setExtensionAttributes() must be an instance of Magento\Quote\Api\Data\TotalsExtensionInterface, instance of Magento\Quote\Api\Data\AddressExtension given

This happens for example when /carts/mine/payment-information is requested while modifying billing address during checkout.

Here's a similar issue with adding extension attributes to CartItemInterface: #3640

Preconditions

  1. Magento 2.1.3 to 2.1.6
  2. Extension attributes defined for quote shipping or billing addresses

Steps to reproduce

Assuming extension attributes for the quote billing address have been defined

  1. login as a user who has at least two addresses in his address book
  2. add a virtual product to card and proceed to checkout
  3. choose or change the billing address, click update

Expected result

  1. no errors, address is changed

Actual result

  1. error is thrown and the checkout loader gets stuck

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for development

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions