From ea70c0ba65fd76c037c33ed77e1e1a40abbdb45a Mon Sep 17 00:00:00 2001 From: Alexander Menk Date: Wed, 18 Mar 2020 15:52:23 +0100 Subject: [PATCH] #26682 Disallow setting extension attributes as data array --- app/code/Magento/Quote/Model/ShippingMethodManagement.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Quote/Model/ShippingMethodManagement.php b/app/code/Magento/Quote/Model/ShippingMethodManagement.php index 73a2a43b2581f..202eeb765216b 100644 --- a/app/code/Magento/Quote/Model/ShippingMethodManagement.php +++ b/app/code/Magento/Quote/Model/ShippingMethodManagement.php @@ -309,7 +309,13 @@ private function getShippingMethods(Quote $quote, $address) { $output = []; $shippingAddress = $quote->getShippingAddress(); - $shippingAddress->addData($this->extractAddressData($address)); + + $extractedAddressData = $this->extractAddressData($address); + if (array_key_exists('extension_attributes', $extractedAddressData)) { + unset($extractedAddressData['extension_attributes']); + } + $shippingAddress->addData($extractedAddressData); + $shippingAddress->setCollectShippingRates(true); $this->totalsCollector->collectAddressTotals($quote, $shippingAddress);