Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CartTotalRepository cannot handle extension attributes in quote addresses #9646

Closed
ekuusela opened this issue May 16, 2017 · 8 comments
Closed
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@ekuusela
Copy link
Contributor

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
magento-team pushed a commit that referenced this issue May 19, 2017
 - Merge Pull Request #9647 from ekuusela/magento2:patch-1
magento-team pushed a commit that referenced this issue May 19, 2017
magento-team pushed a commit that referenced this issue May 19, 2017
[EngCom] Public Pull Requests - 2.1
 - MAGETWO-69238: Keep transparency when resizing images [2.1 backport] #9662
 - MAGETWO-69236: Add configurations for change email templates [2.1 backport] #9661
 - MAGETWO-69235: Do not di:compile tests/ folder #9660
 - MAGETWO-69223 Fix for #9646 #9647
 - MAGETWO-69234: Backport of MAGETWO-69152: Removed workaround for old Webkit bug #9655
@magento-team magento-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development labels Jul 31, 2017
@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-69223

@magento-engcom-team magento-engcom-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed G1 Passed labels Sep 5, 2017
@magento-engcom-team
Copy link
Contributor

Hi @ekuusela
Thank you for reporting and fixing the issue with the PR.
As it is already delivered into 2.1.8 we are closing this issue.
Thank you for collaboration.

@Vikram0811
Copy link

This issue still exist - #14171

@navinbhudiya
Copy link

This issue still exists in Magento 2.2.3

@ycancio
Copy link

ycancio commented Mar 21, 2018

This is still happening in Magento 2.2.3

@treii28
Copy link

treii28 commented Apr 2, 2018

Still experiencing in Magento 2.2.2

@alexishughes
Copy link

This seems to be still happening in M2.2.3. This is the response I got:

{"messages":{"error":[{"code":500,"message":"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, called in /home/hyperst1/public_html/vendor/magento/framework/Api/DataObjectHelper.php on line 125 and defined in /home/hyperst1/public_html/vendor/magento/module-quote/Model/Cart/Totals.php:592\nStack trace:\n#0 /home/hyperst1/public_html/vendor/magento/framework/Api/DataObjectHelper.php(125): Magento\Quote\Model\Cart\Totals->setExtensionAttributes(Object(Magento\Quote\Api\Data\AddressExtension))\n#1 /home/hyperst1/public_html/vendor/magento/framework/Api/DataObjectHelper.php(85): Magento\Framework\Api\DataObjectHelper->_setDataValues(Object(Magento\Quote\Model\Cart\Totals), Array, 'Magento\\Quote\\A...')\n#2 /home/hyperst1/public_html/vendor/magento/module-quote/Model/Cart/CartTotalRepository.php(103): Magento\Framework\Api\DataObjectHelper->populateWithArray(Object(Magento\Quote\Model' in '/home/hyperst1/public_html/vendor/magento/module-quote/Model/Cart/Totals.php' on line 592","trace":"Trace is not available."}]}}

@khaledsawwaf
Copy link

Still in Magento 2.2.3 clear installation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

9 participants