- Issue created by @vipin.j
- 🇮🇳India vipin.j
#3523316 🐛 "Shipment items" must be validated before "Recalculate shipping" click Active fixes this issue.
We have notice an error, when recalculating shipping charges on a "placed" order, while adding a new shipment. Error: Call to a member function getUnit() on null in Drupal\commerce_ups\UPSSdk->getPackages() (line 289 of /var/www/html/web/modules/contrib/commerce_ups/src/UPSSdk.php).
When a shipment is added on a "placed" order from path "/admin/commerce/orders/{commerce_order}/shipments/add/{commerce_shipment_type}"
or follow these steps:
The issue is, executing the getWeight()
method on a shipment entity object, while no shipment item was selected. Though, on the "Add shipment" form the field "Shipment items" is marked as required, but it is not validated against the "Recalculate shipping" button action. We should either validate the button action or block the getWeight()
method execution when no shipment item was selected.
Active
4.0
Code
#3523316 🐛 "Shipment items" must be validated before "Recalculate shipping" click Active fixes this issue.