Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
// @todo ->add() should perform unit conversions automatically.
$shipment_item_weight = $shipment_item_weight->convert($weight->getUnit());
$weight = $weight->add($shipment_item_weight);
Physical 1.0 does the conversion automatically, so we can remove the convert line and the todo above it.
Comment | File | Size | Author |
---|---|---|---|
#2 | physical_unit_conversion_3012518_2.patch | 801 bytes | mitrpaka |
|
Comments
Comment #2
mitrpaka CreditAttribution: mitrpaka as a volunteer commentedPatch applied - Removes both convert lines ($shipment_item_weight and $package_type_weight)
Comment #4
bojanz CreditAttribution: bojanz at Centarro commentedThanks!
Added an additional change to simplify the if/else a bit more and committed.