Steps to reproduce:
1. assuming customer has at least 1 profile in address book.
2. on checkout customer selects the profile and goes to next step.
3. customer decides to change the profile and goes 1 step back.
4. customer sees the checkout pane with address book selector and rendered profile underneath.
5. customer clicks "Edit" button of the profile.
6. customer decides to create a new profile and selects in AddressBook select "Enter a new address".
7. ajax is running and nothing happens, the fields of the profile form are still populated with the data from the profile that was edited.
This is strange bug, because when selecting "Enter a new address" with the rendered profile underneath - the form has no values.
Proposed solution:
1. Add "Cancel" button to edit form, that returns the form to previous state.
2. Hide AddressBook selector while editing the profile.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3084273-4-clear-on-new-address.patch | 5.96 KB | bojanz |
| #4 | commerce-3084273-enter_new_address-4.patch | 2.98 KB | czigor |
| #4 | commerce-3084273-enter_new_address-4-ONLY_TEST.patch | 1.8 KB | czigor |
Comments
Comment #2
bojanz commentedReproduced.
There is no need to go back and forth, on first load of the widget if you click Edit, then select "Enter a new address", the fields stay prefilled.
Both on checkout and in the admin.
The widget is working properly, in the sense that it is still possible to add a new address without affecting the other one, the bug is in the fact that the fields still show previous values.
We have test coverage in CustomerProfileTest, we need to extend it so that it fails in this case.
Comment #3
czigor commentedI'm working on this.
Comment #4
czigor commentedComment #5
bojanz commentedTweaked the patch to follow the style of #3115087: Clear dependent form input when a payment_method is selected at checkout.
Comment #7
bojanz commentedCommitted.