Magento2: Type error in Cart/Totals

Created on 4 Jan 2018  路  5Comments  路  Source: magento/magento2


Preconditions


  1. Magento 2.2.2
  2. PHP 7.1

Steps to reproduce

  1. ??? no idea yet

Expected result

  1. No error logs

Actual result

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, called in /var/www/clones/7.8.1/vendor/magento/framework/Api/DataObjectHelper.php on line 125 and defined in /var/www/clones/7.8.1/vendor/magento/module-quote/Model/Cart/Totals.php:592
Stack trace:
                                                    #0 /var/www/clones/7.8.1/vendor/magento/framework/Api/DataObjectHelper.php(125): Magento\Quote\Model\Cart\Totals->setExtensionAttributes(Object(Magento\Quote\Api\Data\AddressExtension))
                                                    #1 /var/www/clones/7.8.1/vendor/magento/framework/Api/DataObjectHelper.php(85): Magento\Framework\Api\DataObjectHelper->_setDataValues(Object(Magento\Quote\Model\Cart\Totals), Array, 'Magento\\Quote\\A...')
                                                    #2 /var/www/clones/7.8.1/vendor/magento/module-quote/Model/Cart/CartTotalRepository.php(103): Magento\Framework\Api\DataObjectHelper->populateWithArray(Object(Magento\Q

Stubbing this here in case someone else sees this and has more of an idea.

Fixed in 2.2.x Fixed in 2.3.x Clear Description Confirmed Format is valid Ready for Work Reproduced on 2.2.x Reproduced on 2.3.x

Most helpful comment

This is a duplicate of this issue https://github.com/magento/magento2/issues/9646
which has been fixed by this commit - https://github.com/ekuusela/magento2/commit/aa535ea5d4bf78915bddd4387a9d3c4b39943eea
But which is not included in 2.2.2

I've applied the commit manually to my magento store running 2.2.2 and it has fixed the issue for me.

All 5 comments

This is a duplicate of this issue https://github.com/magento/magento2/issues/9646
which has been fixed by this commit - https://github.com/ekuusela/magento2/commit/aa535ea5d4bf78915bddd4387a9d3c4b39943eea
But which is not included in 2.2.2

I've applied the commit manually to my magento store running 2.2.2 and it has fixed the issue for me.

@andrewhowdencom, thank you for your report.
We've created internal ticket(s) MAGETWO-86420 to track progress on the issue.

Hi @andrewhowdencom. Thank you for your report.
The issue has been fixed in magento-engcom/magento2ce#1186 by @p-bystritsky in 2.2-develop branch
Related commit(s):

  • 69cad441761423287c3caa1a05d8ecfe9d1c0c32
  • dc641384de526677dd1bebe349acaa16e7c17475

The fix will be available with the upcoming patch release.

Hi @andrewhowdencom. Thank you for your report.
The issue has been fixed in magento/magento2#17620 by @nmalevanec in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.0 release.

Was this page helpful?
0 / 5 - 0 ratings