Recalculate shipping button blanks address when editing anon order shipments

Created on 24 March 2023, over 1 year ago
Updated 2 January 2024, 11 months ago

Problem/Motivation

When editing a shipment on an order that was placed by an anonymous customer clicking the "Recalculate shipping" button causes the shipping address to be blanked out. This bug was introduced in version 2.2, specifically #3242737: Shipping profile element doesn't work with recalculate on admin shipping form

Steps to reproduce

Have at least commerce_shipping version 2.2 installed
Create an order assigned to anonymous. Create a shipment for that order and save it. Go back to edit the shipment. Click the "Recalculate shipping" button. The shipping address disappears. Saving the shipment saves an empty address. Abandoning the changes and coming back to the shipment edit screen the address is present so the underlying profile is not being modified until saving the shipment.

Proposed resolution

Currently doing further debugging to determine the cause, though I suspect it's because the form is being rebuilt and for whatever reason the code path that sets an empty address is being triggered instead of reusing the existing profile like what happens when the form is initially loaded.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇺🇸United States rhovland Oregon

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024