-
Notifications
You must be signed in to change notification settings - Fork 9.4k

Description
Preconditions
- Magento 2.2.2
Steps to reproduce
- Create an extension that sets an extension attribute on Magento\Quote\Api\Data\AddressInterface during the quote totals collection process
- Create new order via the admin
- Click Add Products
- Select a product, set quantity to 1 and click Add Selected Products to Order
Expected result
- Products are added
Actual result
- Server 500 error
2017/12/29 13:01:10 [error] 347#0: *1657 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: Argument 1 passed to Temando\Shipping\Model\Checkout\Address::setServiceSelection() must be of the type array, null given, called in /var/www/vendor/temando/module-shipping-m2/Observer/SaveCheckoutFieldsObserver.php on line 76 and defined in /var/www/vendor/temando/module-shipping-m2/Model/Checkout/Address.php:78 Stack trace: #0 /var/www/vendor/temando/module-shipping-m2/Observer/SaveCheckoutFieldsObserver.php(76): Temando\Shipping\Model\Checkout\Address->setServiceSelection(NULL) #1 /var/www/vendor/magento/framework/Event/Invoker/InvokerDefault.php(72): Temando\Shipping\Observer\SaveCheckoutFieldsObserver->execute(Object(Magento\Framework\Event\Observer)) #2 /var/www/vendor/magento/framework/Event/Invoker/InvokerDefault.php(60): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Temando\Shipping\Observer\SaveCheckoutFieldsObserver), Object(Magento\Framework\Event\Observer)) #3 /var/www/vendor/magento/framework/Event/Manager.php(66" while reading response header from upstream, client: 172.17.0.3, server: localhost, request: "POST /admin/sales/order_create/loadBlock/block/search,items,shipping_method,totals,giftmessage,billing_method?isAjax=true HTTP/1.0", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "ce-2-2-2-s9ek75.jenkins.fooman.co.nz", referrer: " https://example.com/admin/sales/order_create/index/"
Likely culprit is
Temando\Shipping\Observer\SaveCheckoutFieldsObserver
as this code assumes no other module might be setting extension attributes on the quote address:
if (!$quoteAddress->getExtensionAttributes()) {
return;
}